@polycode-projects/the-mechanical-code-talker 5.0.39 → 5.0.40

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.
@@ -1,41 +1,41 @@
1
- (()=>{var tj=Object.defineProperty;var M=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(s){throw n=[s],s}};var Nt=(e,t)=>{for(var n in t)tj(e,n,{get:t[n],enumerable:!0})};var yt,TF,AF,CF,IF,OF,NF,LF,PF,MF,FF,DF,zF,UF,BF,WF,GF,ne,ye,Gt,su,Dm,VF,HF,qF,Je=M(()=>{yt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},TF=yt("createRequire"),AF=yt("readFileSync"),CF=yt("access"),IF=yt("readFile"),OF=yt("writeFile"),NF=yt("appendFile"),LF=yt("mkdir"),PF=yt("mkdtemp"),MF=yt("rename"),FF=yt("unlink"),DF=yt("rm"),zF=yt("stat"),UF=yt("copyFile"),BF=yt("readdir"),WF=yt("createReadStream"),GF=yt("createWriteStream"),ne=(...e)=>e.join("/"),ye=e=>String(e).replace(/\/[^/]*$/,""),Gt=(...e)=>e.join("/"),su=e=>String(e).startsWith("/"),Dm="/",VF=yt("randomBytes"),HF=yt("spawnSync"),qF=yt("createInterface")});var $t,YF,XF,ou,Ce,er,nj,Vn,zm,ha,ru,Um,sj,JF,oj,QF,ZF,eD,tD,nD,Lt=M(()=>{$t=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},YF=$t("createRequire"),XF=$t("readFileSync"),ou=$t("access"),Ce=$t("readFile"),er=$t("writeFile"),nj=$t("appendFile"),Vn=$t("mkdir"),zm=$t("mkdtemp"),ha=$t("rename"),ru=$t("unlink"),Um=$t("rm"),sj=$t("stat"),JF=$t("copyFile"),oj=$t("readdir"),QF=$t("createReadStream"),ZF=$t("createWriteStream"),eD=$t("randomBytes"),tD=$t("spawnSync"),nD=$t("createInterface")});function tr(e){let t=aj.exec(String(e||""));return t?t[1].toLowerCase():null}function Ws(e,t){return!e||!cj.has(t)?e:e.shape==="ask"?{...e,subject:e.object,object:e.subject}:e.shape==="reverse"?{...e,shape:"forward"}:e.shape==="forward"?{...e,shape:"reverse"}:e}function ga(e){return String(e||"").replace(lj,"$1")}function Gs(e){return e.replace(uj,"").trim()}function pn(e){let t=e;for(let n=0;n<2;n+=1){let s=t.replace(fj,"").trim();if(s=s.replace(mj,"").trim(),s===t)break;t=s}return t}var Bm,Wm,rj,Jr,go,Gm,Vm,ij,aj,Hm,cj,fn,iu,lj,Ln,au,uj,dj,fj,pj,mj,me,Qr,ba,hj,qm,Qe,mn,Vs,wa,cu,lu,uu,Km,Zr,bo,Ym,Xm,wo,vn,bs,nr,ct,Jm,yo,$o,Hn,qn,Qm,ei,sr,ya,or,Zm,Kn=M(()=>{Bm=["is a superclass of","are a superclass of","is a parent class of","are a parent class of","superclass","superclasses"],Wm=["belongs to","belong to","is part of","are part of","is defined in","are defined in"],rj=["lives in","live in","sits in","sit in","sits inside","sit inside"],Jr={imports:{bare:"import",comment:"Module -> Module: subject's import graph references object (usesComplexType).",verbs:["couples to","couple to","depends on","imports","import","relies on","rely on","requires","require","references","reference","pulls in","pull in","built on","builds on","build on","uses code from","grabs","grab","pulls from","pull from","leans on","lean on","is wired to","are wired to","is hooked up to","are hooked up to","importing"]},uses:{bare:"use",comment:"query-side union: imports (Module->Module) + calls (Module->Module) + callsSymbol (fn->fn).",verbs:["uses","use","makes use of","make use of","talks to","talk to","using"]},calls:{bare:"call",comment:"Function/Method -> Function/Class (symbol-grain) or Module -> Module (coarse): subject invokes object.",verbs:["invokes","invoke","calls","call","runs","run","executes","execute","hits","hit","triggers","trigger","fires","fire","kicks off","kick off","calling"]},defines:{bare:"define",comment:"Module -> top-level Function/Class/Method/Attribute: subject declares object.",verbs:["defines","define","declares","declare","has","have","holds","hold","defining"]},contains:{bare:"contain",comment:"Class -> Method/Attribute: subject's membership includes object.",verbs:["contains","contain","containing",...Wm,...rj]},tests:{bare:"test",comment:"Module -> Module: subject is a test module importing/covering object.",verbs:["tests","test","covers","cover","verifies","verify","exercises","exercise","checks","check","makes sure of","make sure of","testing"]},inherits:{bare:"inherit from",comment:"Class -> Class: subject's declared base resolves to object (subclassOf).",verbs:["inherits from","inherit from","inherits","inherit","extends","extend","subclasses","subclass","derives from","derive from","is a subclass of","are a subclass of","is a kind of","are a kind of","is built off","are built off","is built on top of","are built on top of","extending","inheriting from","inheriting","subclassing","extends from",...Bm]},touches:{bare:"touch",comment:"Commit -> Module (coarse) or Commit -> symbol (fine, touchesSymbol): a commit's changed-line-range intersects object.",verbs:["touched","touches","changed","change","modified","modifies","was changed in","were changed in","was edited in","were edited in","was modified by","were modified by","was tweaked in","were tweaked in","got changed in","got edited in","touch","changed in","landed in","land in","was in","were in","went into","included in","updated","edited","touching"]},cochange:{bare:"co-change with",comment:"Module -> Module: subject and object are frequently committed together (changeCoupledWith).",verbs:["changed with","co-changes with","co-change with","changes alongside","change alongside","shares commits with","share commits with","tends to change together with","tend to change together with","moves together with","move together with","changed together with","change together with","changes together with","changes with","change with","tends to change with","tend to change with","usually changes with"]},reexports:{bare:"re-export",comment:"Module -> exported symbol: subject's public API surface (__all__/export list).",verbs:["exports","export","re-exports","re-export","passes through","pass through","exposes","expose","exporting"]},serves:{bare:"serve",comment:"subject provides or backs the object \u2014 a handler serving a route, a module serving a surface (mgx:serves).",verbs:["serves","serve","serving"]},denotes:{bare:"denote",comment:"subject names the object \u2014 a glossary/lexicon term denoting a code entity (mgx:denotes).",verbs:["denotes","denote","denoting"]}},go=Object.freeze({placement:Object.freeze({predicate:"mgx:currently-in",comment:"individual -> place: where the subject is right now.",nouns:Object.freeze(["location","locations","position","positions","place","places","whereabouts","room","rooms"]),reads:"is in",matchesLocativePredicates:!0}),mood:Object.freeze({predicate:"mgx:feels",comment:"individual -> mood word: how the subject feels right now.",nouns:Object.freeze(["mood","moods","feeling","feelings","emotion","emotions"]),reads:"feels"}),mass:Object.freeze({predicate:"mgx:hasMass",comment:"individual -> number: the subject's current mass.",nouns:Object.freeze(["mass","masses","weight","weights"]),reads:"has mass"})}),Gm=Object.freeze(Object.fromEntries(Object.entries(go).flatMap(([e,{nouns:t}])=>t.map(n=>[n,e])))),Vm=Object.freeze(Object.values(go).map(e=>e.predicate)),ij=Object.freeze(["on","in","at","inside","under","below","above","near","beside","behind","by"]),aj=new RegExp(`^mgx:[a-z]+-(${ij.join("|")})$`,"i");Hm=Object.freeze([...Bm,"is the superclass of","are the superclass of","is the parent class of"]),cj=Object.freeze(new Set([...Hm,...Wm]));fn=Object.freeze(["defined","declared","located","implemented"]),iu=Object.freeze(["now","currently","right now","at the moment","these days","today"]),lj=new RegExp(`\\s+(?:${[...iu].sort((e,t)=>t.length-e.length).join("|")})(\\s*[?.!]*)$`,"i");Ln=Object.freeze(["mentioned","referenced"]),au=Object.freeze(["in this graph","in the graph","in this codebase","in the codebase","in this repo","in the repo","here"]),uj=new RegExp(`\\s+(?:${au.join("|")})\\s*[?.!]*$`,"i");dj=Object.freeze(["then","though","too"]),fj=new RegExp(`\\s+(?:${dj.join("|")})\\s*[?.!]*$`,"i"),pj=Object.freeze(["please explain","explain"]),mj=new RegExp(`,\\s*(?:${pj.join("|")})\\s*[?.!]*$`,"i");me=Object.freeze(Object.fromEntries(Object.entries(Jr).flatMap(([e,{verbs:t}])=>t.map(n=>[n,e])))),Qr=Object.freeze(new Set(["has","have","holds","hold"])),ba=Object.freeze(new Set(["search","describe","signature","impact","members","subclasses","exports","callers","callees","calls","tests","untested","history","cochanges","architecture","arch","related","sprite"])),hj=e=>!Hm.includes(e),qm=Object.freeze([...new Set(Object.keys(me).filter(hj).map(e=>e.match(/^(?:is|are)\s+an?\s+(.+)$/i)).filter(Boolean).map(e=>e[1].toLowerCase()))]),Qe=Object.freeze({function:"Function",functions:"Function",method:"Method",methods:"Method",class:"Class",classes:"Class",module:"Module",modules:"Module",mod:"Module",mods:"Module",file:"Module",files:"Module",package:"Package",packages:"Package",attribute:"Attribute",attributes:"Attribute",field:"Attribute",fields:"Attribute",variable:"GlobalVariable",variables:"GlobalVariable",global:"GlobalVariable",globals:"GlobalVariable",change:"Change",changes:"Change",commit:"Commit",commits:"Commit"}),mn=Object.freeze({explicitly:"direct",directly:"direct",transitively:"transitive",indirectly:"transitive"}),Vs=Object.freeze({imported:"imports",called:"calls",used:"uses",tested:"tests",covered:"tests",verified:"tests",exercised:"tests",checked:"tests",defined:"defines",declared:"defines",inherited:"inherits",extended:"inherits",subclassed:"inherits",contained:"contains",exported:"reexports","re-exported":"reexports",exposed:"reexports",touched:"touches",changed:"touches",modified:"touches",edited:"touches",updated:"touches"}),wa=Object.freeze({"inherited from":{kind:"inherits",role:"object"},"extended from":{kind:"inherits",role:"object"},"subclassed from":{kind:"inherits",role:"object"},"defined in":{kind:"defines",role:"agent"},"declared in":{kind:"defines",role:"agent"},"contained in":{kind:"contains",role:"agent"},"imported by":{kind:"imports",role:"agent"},"called by":{kind:"calls",role:"agent"},"used by":{kind:"uses",role:"agent"},"tested by":{kind:"tests",role:"agent"},"covered by":{kind:"tests",role:"agent"},"touched by":{kind:"touches",role:"agent"},"changed by":{kind:"touches",role:"agent"},"exported by":{kind:"reexports",role:"agent"}}),cu=Object.freeze({"ain't":"is not",aint:"is not","isn't":"is not",isnt:"is not","aren't":"are not",arent:"are not","doesn't":"does not",doesnt:"does not","don't":"do not",dont:"do not","didn't":"did not",didnt:"did not","there's":"there is",theres:"there is","what's":"what is",whats:"what is","who's":"who is",whos:"who is",gonna:"going to",wanna:"want to",gotta:"got to",yer:"your",ur:"your",gimme:"give me"}),lu=Object.freeze({funtion:"function",funtions:"functions",fucntion:"function",fucntions:"functions",functoin:"function",functoins:"functions",calss:"class",calsses:"classes",classs:"class",clases:"classes",modul:"module",moduls:"modules",moduel:"module",moduels:"modules",moudle:"module",moudles:"modules",methdo:"method",methdos:"methods",mehtod:"method",mehtods:"methods",comit:"commit",comits:"commits",commmit:"commit",commmits:"commits",varaible:"variable",varaibles:"variables",varibale:"variable",varibales:"variables",atribute:"attribute",atributes:"attributes",improt:"import",improts:"imports",imoprt:"import",imoprts:"imports",inherts:"inherits",inheirts:"inherits",extands:"extends",extneds:"extends",depnds:"depends",touchs:"touches",tuoches:"touches",touhced:"touched",touchd:"touched",defned:"defined",chagned:"changed",chnaged:"changed",chagnes:"changes",chnages:"changes",calles:"calls",exprot:"export",exprots:"exports",tets:"tests",whcih:"which",wich:"which",whihc:"which",wehre:"where",whre:"where",waht:"what",wat:"what",dat:"that",dose:"does",doess:"does",teh:"the",manyn:"many",mnay:"many",amny:"many",mnany:"many",hwo:"how",coutn:"count",conut:"count",cuont:"count",ocunt:"count",numer:"number",nubmer:"number",numbr:"number",nmuber:"number",lst:"list",lsit:"list",ilst:"list",shwo:"show",hsow:"show",dispaly:"display",dsiplay:"display",funtcions:"functions",funciton:"function",funcitons:"functions"}),uu=Object.freeze({folder:"module",folders:"modules",directory:"module",directories:"modules",func:"function",funcs:"functions",changeset:"commit",changesets:"commits",revision:"commit",revisions:"commits",property:"attribute",properties:"attributes"}),Km=/\b([a-z]{3,})in'/gi,Zr=Object.freeze(["um","uh","erm","so","like","yo","hey","bru","bro","fam","mate","please","could you","can you","would you","tell me","i wonder","just wondering","quickly","real quick","kinda","sorta","btw","by the way","you","quick q"]),bo=Object.freeze(["this","it","that","here","this one","that one"]),Ym=Object.freeze([{re:/\bthere\s+is\s+not\s+(?:anything|nothing)\s+(?:that\s+)?(\S.*)$/i,to:e=>`what ${e[1]}`},{re:/\bthere\s+is\s+no\s+\S+\s+(?:that\s+)?(\S.*)$/i,to:e=>`what ${e[1]}`},{re:/\bis\s+not\s+there\s+(?:anything|nothing)\s+(?:that\s+)?(\S.*)$/i,to:e=>`what ${e[1]}`},{re:/\b(?:nobody|nothing|no one)\s+(\S.*?)(?:,?\s+does\s+it\??|,?\s+do\s+they\??)?$/i,to:e=>`what ${e[1]}`}]),Xm=Object.freeze([{re:/^what\s+(?:is|was|were|are)\s+in\s+((?:commit\s+)?[0-9a-f]{7,40})\??$/i,to:e=>`what did ${e[1]} touch`},{re:/^what\s+(?:went|got)\s+into\s+((?:commit\s+)?[0-9a-f]{7,40})\??$/i,to:e=>`what did ${e[1]} touch`},{re:/^what\s+made\s+it\s+into\s+((?:commit\s+)?[0-9a-f]{7,40})\??$/i,to:e=>`what did ${e[1]} touch`}]),wo=Object.freeze(["mean","means","stand for","stands for","signify","signifies","represent","represents","refer to","refers to"]),vn=Object.freeze(["that","which","who"]),bs=Object.freeze(["something","anything","everything","somethings","things","thing","entities","entity","nodes","node","stuff","code","symbol","symbols"]),nr=Object.freeze({"but do not":"difference","but does not":"difference","and do not":"difference","and does not":"difference","but not":"difference","and not":"difference",except:"difference",without:"difference",and:"intersection",plus:"intersection",but:"intersection",or:"union"}),ct=Object.freeze({public:{via:"visibility",value:"public"},private:{via:"visibility",value:"private"},protected:{via:"visibility",value:"protected"},static:{via:"attr",attr:"isStatic"},abstract:{via:"attr",attr:"isAbstract"},constant:{via:"attr",attr:"isConstant"},exported:{via:"exported"},"re-exported":{via:"exported"},tested:{via:"tested",value:!0},covered:{via:"tested",value:!0},untested:{via:"tested",value:!1},uncovered:{via:"tested",value:!1}}),Jm=Object.freeze(new Set(["tests","test","anything","something","anyone","someone","any"])),yo=Object.freeze(["how many","how much","how many of","number of","total number of","quantity of","tally of","sum of","total of","amount of","count","count up","count of","tot up"]),$o=Object.freeze(["list","show","show me","show us","display","print","print out","dump","enumerate","name","give me","get me","spit out","rattle off","run down","run through","ls","what are","which are"]),Hn=Object.freeze({most:"most",greatest:"most",highest:"most",biggest:"most",largest:"most","most-connected":"most","most connected":"most",fewest:"fewest",least:"fewest",smallest:"fewest",lowest:"fewest"}),qn=Object.freeze({imports:{kind:"imports",dir:"out"},dependencies:{kind:"imports",dir:"out"},importers:{kind:"imports",dir:"in"},dependents:{kind:"imports",dir:"in"},callers:{kind:"calls",dir:"in",sibling:"callsSymbol"},callees:{kind:"calls",dir:"out",sibling:"callsSymbol"},calls:{kind:"calls",dir:"out",sibling:"callsSymbol"},methods:{kind:"contains",dir:"out",filter:"Method"},members:{kind:"contains",dir:"out"},tests:{kind:"tests",dir:"in"},test:{kind:"tests",dir:"in"},subclasses:{kind:"inherits",dir:"in"},connections:{kind:"*",dir:"both"},edges:{kind:"*",dir:"both"},connected:{kind:"*",dir:"both"},imported:{kind:"imports",dir:"in"},"depended-on":{kind:"imports",dir:"in"},depended:{kind:"imports",dir:"in"},used:{kind:"imports",dir:"in",sibling:"callsSymbol"},called:{kind:"calls",dir:"in",sibling:"callsSymbol"}}),Qm=Object.freeze({tests:"Module",test:"Module"}),ei=Object.freeze(["those","them","these"]),sr=Object.freeze(["contains","defines"]),ya=Object.freeze(["the","a","an","some","other","about","please","pls","plz","kindly","just","simply","maybe","perhaps","thanks","thank","ta","cheers","too","also","well","either","sorry","oops","actually","mean","meant","rather","hi","hello","hey","yo","hiya","howdy","ok","okay","matey","mate","buddy","pal","dude","man","bro","bru","fam","friend","sir","maam","folks","guys","everyone","dear","tmct","show","tell","give","list","find","me","us","lemme"]),or=Object.freeze({tally:"count",tallies:"count",sum:"count",total:"count",totals:"count"}),Zm=Object.freeze(["help","help me","how do i ask","how do i use this","what can i ask","what can you ask","usage","commands","examples","syntax","options"])});var Ze,Hs,$a=M(()=>{Ze="#000000",Hs=Object.freeze({happy:`<circle cx="-0.4" cy="-0.15" r="0.11" fill="${Ze}" opacity="0.85"/><circle cx="0.4" cy="-0.15" r="0.11" fill="${Ze}" opacity="0.85"/><path d="M -0.4 0.35 Q 0 0.68 0.4 0.35" fill="none" stroke="${Ze}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,sad:`<circle cx="-0.4" cy="-0.1" r="0.1" fill="${Ze}" opacity="0.85"/><circle cx="0.4" cy="-0.1" r="0.1" fill="${Ze}" opacity="0.85"/><path d="M -0.38 0.55 Q 0 0.3 0.38 0.55" fill="none" stroke="${Ze}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,angry:`<path d="M -0.58 -0.32 L -0.22 -0.16" stroke="${Ze}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><path d="M 0.58 -0.32 L 0.22 -0.16" stroke="${Ze}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><circle cx="-0.32" cy="-0.02" r="0.09" fill="${Ze}" opacity="0.85"/><circle cx="0.32" cy="-0.02" r="0.09" fill="${Ze}" opacity="0.85"/><path d="M -0.36 0.5 L 0.36 0.42" stroke="${Ze}" stroke-width="0.1" stroke-linecap="round" opacity="0.85"/>`,scared:`<circle cx="-0.4" cy="-0.12" r="0.2" fill="none" stroke="${Ze}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.4" cy="-0.12" r="0.07" fill="${Ze}" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.2" fill="none" stroke="${Ze}" stroke-width="0.07" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.07" fill="${Ze}" opacity="0.85"/><circle cx="0" cy="0.42" r="0.09" fill="none" stroke="${Ze}" stroke-width="0.07" opacity="0.85"/>`,surprised:`<circle cx="-0.38" cy="-0.12" r="0.17" fill="none" stroke="${Ze}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.38" cy="-0.12" r="0.06" fill="${Ze}" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.17" fill="none" stroke="${Ze}" stroke-width="0.07" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.06" fill="${Ze}" opacity="0.85"/><ellipse cx="0" cy="0.42" rx="0.16" ry="0.22" fill="${Ze}" opacity="0.7"/>`,calm:`<path d="M -0.5 -0.1 Q -0.4 -0.2 -0.3 -0.1" fill="none" stroke="${Ze}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/><path d="M 0.3 -0.1 Q 0.4 -0.2 0.5 -0.1" fill="none" stroke="${Ze}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/><path d="M -0.3 0.4 Q 0 0.5 0.3 0.4" fill="none" stroke="${Ze}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/>`})});var gj,xn,eh,th,du,nh,cD,lD,sh=M(()=>{Kn();$a();gj=()=>Object.keys(Hs).sort(),xn=e=>({type:"object",required:["symbol"],properties:{symbol:{type:"string",description:e}}}),eh=e=>({type:"object",required:["module"],properties:{module:{type:"string",description:e}}}),th=e=>({type:"object",required:["class"],properties:{class:{type:"string",description:e}}}),du=Object.freeze([{name:"tmct_context",tier:"hot",summary:"A sized edit bundle for one symbol \u2014 exemplar source, sibling signatures, registration anchor and the insertion region, in one call.",agentDescription:"START HERE to add/modify code: ONE call returns a sized edit bundle (exemplar source, sibling signatures, registration, insertion region) \u2014 then write directly, don't Read.",inputSchema:{type:"object",required:["symbol"],properties:{symbol:{type:"string",description:"Module path (e.g. path/to/module) or a sibling function/class name defined in it."},depth:{type:"string",enum:["min","auto","full"],default:"auto",description:"auto (sized to the task) | min (leanest) | full (every section)."}}},example:{symbol:"django/utils/text.py"}},{name:"tmct_snippet",tier:"hot",summary:"The exact source of one function, class or Class.method \u2014 its line span only, plus a one-line in-repo call hint.",agentDescription:"EXACT source of one function/class/Class.method by name (its line span only) + a one-line in-repo call hint. Prefer over Read for a single symbol.",inputSchema:{type:"object",required:["symbol"],properties:{symbol:{type:"string",description:"function/class name, Class.method, or fn:<path>#name."}}},example:{symbol:"Truncator.chars"}},{name:"tmct_ask",tier:"hot",summary:"A structural question in plain English, answered from the graph in one call \u2014 no model, and a clean miss instead of a guess.",agentDescription:'Ask a structural question in plain English: "which functions call X", "what uses X", "where is X defined", "when did X change". One call, no model. A clean miss beats a guess.',inputSchema:{type:"object",required:["query"],properties:{query:{type:"string",description:'A free-text question, e.g. "which functions explicitly couple to logging".'}}},example:{query:"which modules import src/core/model.mjs"},chat:{exampleRepo:"examples/mini-webapp",grammar:[{form:"which <things> <relation-verb> <entity>",example:"which modules import src/core/model.mjs",answers:"the imports edge, read forwards"},{form:"what is <relation-verb-passive> <entity>",example:"what is imported by src/core/store.mjs",answers:"the same edge, read backwards \u2014 a passive is the opposite direction, not a synonym"},{form:"what <relation-verb> <entity>",example:"what uses src/lib/http.mjs",answers:"the uses union: imports plus calls"},{form:"where is <entity> <where-marker>",example:"where is saveStore defined",answers:"the definition's file and line span"},{form:"when did <entity> change",example:"when did src/core/store.mjs change",answers:"the commits that touched it, newest first"}],whereMarkers:fn}},{name:"tmct_describe",tier:"cold",summary:"Locate one symbol and list its typed edges (both directions) with provenance.",inputSchema:xn("A module path, symbol name, or Class.method."),example:{symbol:"django/utils/text.py"}},{name:"tmct_signature",tier:"cold",summary:"One symbol's API surface (params, returns, raises/catches, flags, decorators, doc) without the body.",inputSchema:xn("A function, method, or Class.method name."),example:{symbol:"Truncator.chars"}},{name:"tmct_impact",tier:"cold",summary:"Transitive reverse closure over imports/calls \u2014 what breaks if a module or symbol changes, by depth, with tests.",inputSchema:eh("The module (or a symbol it defines) whose dependents you want."),example:{module:"django/utils/text.py"}},{name:"tmct_search",tier:"cold",summary:"Free-text/ranked lookup over the code-map to find the right module or symbol.",inputSchema:{type:"object",required:[],properties:{query:{type:"string",description:"Free text to rank against the code-map. Required unless kind narrows the search on its own."},kind:{type:"string",description:"Restrict to an entity class, e.g. function, class, module."},decorator:{type:"string",description:"Restrict to definitions carrying this decorator."},name:{type:"string",description:"Restrict to definitions whose name matches."}}},example:{query:"template filters",kind:"function"}},{name:"tmct_members",tier:"cold",summary:"A class's methods + attributes (file:line, decorators) in one slice.",inputSchema:th("The class whose members you want."),example:{class:"Truncator"}},{name:"tmct_subclasses",tier:"cold",summary:"A class's base classes plus the transitive set of classes that extend it.",inputSchema:th("The class to walk the inheritance edges of."),example:{class:"Field"}},{name:"tmct_related",tier:"cold",summary:"A term's synonyms (skos:altLabel) and related concepts (skos:related), from the memory graph's relation facts.",inputSchema:{type:"object",required:["term"],properties:{term:{type:"string",description:"The term whose synonyms / related concepts you want."}}},example:{term:"sofa"}},{name:"tmct_sprite",tier:"cold",summary:"The sprite markup for a class, resolved up the taught rdfs:subClassOf chain \u2014 with the expression and size asked for, and the ancestor chain the resolver walked to find it.",inputSchema:{type:"object",required:["class"],properties:{class:{type:"string",description:"The class to draw, e.g. spider. Resolved through the memory graph's own rdfs:subClassOf taxonomy."},expression:{type:"string",enum:gj(),description:"The face the sprite wears, as an mgx:feels value. A class whose template takes no expression parameter misses rather than dropping it."},size:{type:"string",description:"A taught size property word (mgx:hasProperty), resolved to a numeric render SCALE \u2014 the size of the thing drawn, not a choice of template tier."}}},example:{class:"spider",expression:"happy",size:"large"}},{name:"tmct_architecture",tier:"cold",summary:"Package/module map + the most-imported hub modules (optionally scoped to a package).",inputSchema:{type:"object",required:[],properties:{package:{type:"string",description:"Scope the map to one package. Omit for the whole repository."}}},example:{package:"django/template"}},{name:"tmct_exports",tier:"cold",summary:"A module's public __all__ surface, each name resolved to the module that defines it.",inputSchema:eh("The module whose public API surface you want."),example:{module:"django/db/models/__init__.py"}},{name:"tmct_tests_for",tier:"cold",summary:"The test modules covering a symbol or module, from the typed test edges.",inputSchema:xn("The symbol or module to find covering tests for."),example:{symbol:"django/utils/text.py"}},{name:"tmct_untested",tier:"cold",summary:"Source modules with no covering test module \u2014 a coverage-gap view (no arguments).",inputSchema:{type:"object",required:[],properties:{}},example:{}},{name:"tmct_history",tier:"cold",summary:"Recent commits that touched a symbol's module (newest first).",inputSchema:xn("The symbol whose module's history you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_file_history",tier:"cold",summary:"Commits that touched a symbol's module, each with author / date / subject.",inputSchema:xn("The symbol whose module's history you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_method_history",tier:"cold",summary:"Commits that touched a specific method symbol (fine-grained), with author / date / subject.",inputSchema:xn("A Class.method name."),example:{symbol:"Truncator.chars"}},{name:"tmct_class_history",tier:"cold",summary:"Commits that touched a specific class symbol (fine-grained), with author / date / subject.",inputSchema:xn("A class name."),example:{symbol:"Truncator"}},{name:"tmct_callers",tier:"cold",summary:"Modules that call into a symbol's module (one hop).",inputSchema:xn("The symbol whose callers you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_callees",tier:"cold",summary:"Modules a symbol's module calls into (one hop).",inputSchema:xn("The symbol whose callees you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_calls",tier:"cold",summary:"The in-repo symbols a function calls (fn\u2192fn), each with file:line.",inputSchema:xn("The function whose in-repo call sites you want."),example:{symbol:"slugify"}},{name:"tmct_cochanges",tier:"cold",summary:"Modules that historically change in the same commit as a symbol's module (git co-change).",inputSchema:xn("The symbol whose module's change-coupling you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_context_more",tier:"cold",summary:"The bundle sections a lean tmct_context omitted (siblings / tests / cochange / class members / re-exports).",inputSchema:xn("The symbol a lean tmct_context bundle was built for."),example:{symbol:"django/utils/text.py"}},{name:"tmct_export",tier:"cold",summary:"Every stored memory fact as JSONL (subject/predicate/object/provenance) \u2014 the shape `tmct extract` emits, for backup or audit.",inputSchema:{type:"object",required:[],properties:{}},example:{}},{name:"tmct_ingest",tier:"cold",summary:"Ground plain text into memory facts with the same deterministic recognizer the chat teach lane uses \u2014 the strict tier, plus an optional lower-trust fuzzy tier \u2014 and report the canonical triples.",inputSchema:{type:"object",required:["text"],properties:{text:{type:"string",description:"The plain text to ground into facts."},optimistic:{type:"boolean",description:"Also run the lower-trust fuzzy tier over sentences the strict recognizer skips."}}},example:{text:"A kettle is a container. An otter is a mammal.",optimistic:!0}}]),nh=du.filter(e=>e.tier==="hot"),cD=du.filter(e=>e.tier==="cold"),lD=Object.freeze(du.map(e=>e.name))});var oh,Oe,Kt=M(()=>{Je();oh=ne(".tmct","graph.json"),Oe=class extends Error{constructor(t){super(t),this.name="ToolError"}}});function bj(e){let t=new Set;for(let n of Array.isArray(e?.individuals)?e.individuals:[])n&&n.id&&t.add(n.id);return t}function rh(e){let t=(Array.isArray(e)?e:[]).map((c,l)=>({file:c?.file,payload:c?.payload||{},name:c?.name!=null&&String(c.name).length?String(c.name):String(l)})),n=t.map(({payload:c})=>bj(c)),s=new Map;for(let c of n)for(let l of c)s.set(l,(s.get(l)||0)+1);let o=new Set([...s.entries()].filter(([,c])=>c>1).map(([c])=>c)),r={generated_at:"",classes:[],vocabulary:[],objectProperties:[],individuals:[],proseIndex:{}},i="",a=t.length>0;for(let{payload:c,name:l}of t){a=a&&!!c.bootstrap,typeof c.generated_at=="string"&&c.generated_at>i&&(i=c.generated_at);let u=p=>o.has(p)?`${l}/${p}`:p;Array.isArray(c.classes)&&r.classes.push(...c.classes),Array.isArray(c.vocabulary)&&r.vocabulary.push(...c.vocabulary);for(let p of Array.isArray(c.individuals)?c.individuals:[]){if(!p)continue;let f={...p};f.id&&(f.id=u(f.id)),Array.isArray(f.derived_from)&&(f.derived_from=f.derived_from.map(m=>u(m))),Array.isArray(f.mentions)&&(f.mentions=f.mentions.map(m=>m&&m.id?{...m,id:u(m.id)}:m)),r.individuals.push(f)}for(let p of Array.isArray(c.objectProperties)?c.objectProperties:[]){if(!p)continue;let f={...p};Array.isArray(f.examples)&&(f.examples=f.examples.map(m=>{if(!m)return m;let h={...m};return h.subject&&(h.subject=u(h.subject)),h.object&&(h.object=u(h.object)),h})),r.objectProperties.push(f)}let d=c.proseIndex&&typeof c.proseIndex=="object"?c.proseIndex:{};for(let[p,f]of Object.entries(d)){let m=r.proseIndex[p]||(r.proseIndex[p]=[]);for(let h of Array.isArray(f)?f:[]){let g=u(h);m.includes(g)||m.push(g)}}}return r.generated_at=i,a&&(r.bootstrap=!0),r}var ih=M(()=>{});var ir={};Nt(ir,{clearCache:()=>wj,emptyEntities:()=>fu,fetchEntities:()=>xj,registerProvider:()=>yj});function wj(){rr=null,ti=null}function yj(e){if(e!=null&&typeof e!="function")throw new TypeError("registerProvider expects a function (config) => entities payload, or null");let t=va;return va=e??null,rr=null,t}function fu(){return{generated_at:"",bootstrap:!0,classes:[],vocabulary:[],objectProperties:[],individuals:[],proseIndex:{}}}async function $j(e){let t;try{t=await Ce(e,"utf8")}catch(n){if(n?.code==="ENOENT")return fu();throw new Oe(`cannot read graph artifact at ${e} (${n?.code||n?.message||n})`)}try{return JSON.parse(t)}catch{throw new Oe(`graph artifact ${e} is not valid JSON`)}}async function vj(e){let t=e.graphFiles,n=[...t].map(String).sort().join("|");if(ti&&ti.key===n)return ti.payload;let s=[];for(let r=0;r<t.length;r++){let i=await $j(t[r]);s.push({file:t[r],payload:i,name:e.graphNames?.[r]})}let o=rh(s);return ti={key:n,payload:o},o}async function xj(e){if(va){let s;try{s=await va(e)}catch(o){throw o instanceof Oe?o:new Oe(`graph provider failed (${o?.message||o})`)}if(!s||typeof s!="object")throw new Oe("graph provider returned no entities payload");return s}if(Array.isArray(e.graphFiles)&&e.graphFiles.length>1)return vj(e);if(rr&&rr.file===e.graphFile)return rr.payload;let t;try{t=await Ce(e.graphFile,"utf8")}catch(s){if(s?.code==="ENOENT")return fu();throw new Oe(`cannot read graph artifact at ${e.graphFile} (${s?.code||s?.message||s})`)}let n;try{n=JSON.parse(t)}catch{throw new Oe(`graph artifact ${e.graphFile} is not valid JSON`)}return rr={file:e.graphFile,payload:n},n}var rr,ti,va,ni=M(()=>{Lt();Kt();ih();rr=null,ti=null,va=null});function Yn(e){if(!e)return[];let t=String(e).replace(/\.[A-Za-z0-9]+$/,"");return t=t.replace(/[/\\]/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/([A-Za-z])([0-9])/g,"$1 $2").replace(/([0-9])([A-Za-z])/g,"$1 $2").replace(/[_\-.]+/g," "),t.split(/\s+/).map(n=>n.toLowerCase()).filter(n=>n.length>1&&n.length<=ah)}function pu(e){if(!e)return[];let t=[],n=new Set;for(let s of String(e).toLowerCase().split(/[^a-z0-9]+/))if(!(s.length<2||s.length>ah||Ej.has(s))&&!n.has(s)&&(n.add(s),t.push(s),t.length>=Sj))break;return t}function xa({name:e,doc:t}={}){return[...new Set([...Yn(e),...pu(t)])].sort()}function ch(e){let t=Object.create(null);for(let n of e){let s=(n.attributes||[]).find(o=>o.key==="prose_tokens");if(s?.value)for(let o of s.value.split(" "))t[o]||(t[o]=[]),t[o].push(n.id)}for(let n of Object.keys(t))t[n].sort();return t}function vo(e,t,{limit:n=10}={}){let s=[...new Set([...Yn(t),...pu(t)])];if(!s.length)return[];let o=new Map;for(let r of s)for(let i of e?.[r]||[])o.set(i,(o.get(i)||0)+1);return[...o.entries()].sort((r,i)=>i[1]-r[1]||String(r[0]).localeCompare(i[0])).slice(0,n).map(([r,i])=>({id:r,score:i}))}function lh(e,t){let n=e&&(e["tmct:layers"]?e:e.proseIndex),s=n&&n["tmct:layers"],o=String(t||"").toLowerCase(),r={ids:[],via:null};if(!o||!s||typeof s!="object")return r;let i=new Set,a=new Set;for(let c of Object.keys(s)){let l=s[c];if(!l||typeof l!="object")continue;let u=l[o],d=Array.isArray(u)?u:Array.isArray(u?.ids)?u.ids:null;if(d?.length){for(let p of d)i.add(p);a.add(c)}}return i.size?{ids:[...i].sort(),via:[...a].sort().join("+")}:r}var Ej,ah,Sj,qs=M(()=>{Ej=new Set("a an and or but the of to in on at for with from by as is are was were be been being it its this that these those i you he she they we me my your our do does did not no yes if then else than so such can will would should could may might about into over under out up down off again more most some any all what which who whom whose when where why how".split(/\s+/)),ah=40,Sj=120});function uh(e){let t=e.indexOf("@"),n=t>=0?e.slice(0,t):e,s=t>=0?e.slice(t+1):"",o=n.indexOf(":"),r=o>=0?n.slice(o+1):"";return{createdAt:s,...r?{sessionId:r}:{}}}function jj(e){if(!e.startsWith(fh))return null;let t=e.indexOf("@"),n=t>=0?e.slice(0,t):e,s=t>=0?e.slice(t+1):"",o=n.indexOf(dh);if(o<0)return null;let r=n.slice(o+dh.length);return r?{kind:"teachNode",nodeId:r,displayName:n.slice(fh.length,o),createdAt:s}:null}function Pn(e){let t=String(e||"").trim();if(!t)return null;if(t.startsWith("reference:")){let s=t.slice(10),o=s.indexOf(":");if(o<0)return{kind:"reference",pack:s||"unknown",article:""};let r=s.slice(0,o)||"unknown";return{kind:Rj(r),pack:r,article:s.slice(o+1)}}if(t.startsWith("research:")){let s=t.slice(9),o=s.lastIndexOf("@");return{kind:"referenceLive",pack:"research",article:(o>=0?s.slice(0,o):s).trim()||"unknown"}}let n=t.split(/\s+/)[0];if(n.startsWith("corpus-weak:"))return{kind:"corpusWeak",name:n.slice(12)||"unknown"};if(n.startsWith("corpus:"))return{kind:"corpus",name:n.slice(7)||"unknown"};if(n.startsWith("child:"))return{kind:"corpus",name:n.slice(6).split(":")[0]||"unknown"};if(n.startsWith("world:"))return{kind:"corpus",name:n.slice(6).split(":")[0]||"unknown"};if(n.startsWith("mud:"))return{kind:"corpus",name:`mud:${n.slice(4).split(":")[0]||"unknown"}`};if(n.startsWith("ace:"))return{kind:"operator",...uh(n.slice(4))};if(n.startsWith("teach:")){let s=n.slice(6),o=jj(s);return o||{kind:"teach",...uh(s)}}return n.startsWith("web:")?{kind:"web",url:n.slice(4)}:n.startsWith("url:")?{kind:"web",url:n.slice(4)}:n.startsWith("news-fixture:")?{kind:"corpus",name:n.slice(13).split("@")[0]||"unknown"}:n.startsWith("extracted:news:")?{kind:"web",url:n.slice(10)}:n.startsWith("news:")?{kind:"web",url:n}:n.startsWith("optimistic-extract:")?{kind:"optimisticExtract",name:n.slice(19)||"unknown"}:n.startsWith("extracted:")?{kind:"extracted",name:n.slice(10)||"unknown"}:n.startsWith("entailed:")?{kind:"entailed",rule:n.slice(9)}:n.startsWith("chat:")||n.startsWith("session:")||n.startsWith("operator")?{kind:"operator"}:null}function bh(e){let t=(e?.attributes||[]).find(s=>s.prop==="mgx:sourceReliability")?.value;if(t===void 0)return mh;let n=Number(t);return Number.isFinite(n)?Math.max(mu,Math.min(gh,n)):mh}function wh(e,t=Date.now(),n=_j){let s=Date.parse(e);if(!Number.isFinite(s))return 1;let o=Math.max(0,t-s);return ph+(1-ph)*Math.pow(.5,o/n)}function yh(e,t={},n={}){let s=typeof n.now=="number"?n.now:Date.now(),o=Array.isArray(e?.sourceIds)?e.sourceIds:[],r=new Set,i=[],a=[];for(let f of o){if(r.has(f))continue;r.add(f);let m=t[f],h=Tj(m);if(!h)continue;i.push(h);let g=(ws[h]??0)*bh(m);a.push(Math.max(0,Math.min(1,g)))}let c=0,l=1;for(let f of a)l*=1-f;if(a.length&&(c=Math.min(1,1-l)),i.includes("entailed")&&Array.isArray(n.premiseTrusts)&&n.premiseTrusts.length){let f=typeof n.ruleConfidence=="number"?n.ruleConfidence:1;c=Math.max(0,Math.min(1,Math.min(...n.premiseTrusts)*f))}let u=wh(e?.createdAt,s,n.halfLifeMs),d=ar(Math.min(1,c*u)),p={sourceTypes:i.slice().sort(),corroboration:i.length,createdAt:e?.createdAt||"",recency:ar(u)};return{score:d,inputs:p}}function Sa(e,t){let n=(ws[e]??0)*bh(t);return ar(Math.max(0,Math.min(1,n)))}function Aj(e){if(e==="operator")return 1;let t=ws[e];return t===void 0?1:(t+1)/2}function ja(e,t={}){let n=typeof t.now=="number"?t.now:Date.now(),s=Array.isArray(e)?e:[],o=new Map,r=[];for(let a of s){let c=wh(a?.assertedAt,n,t.halfLifeMs),l=Math.max(0,Math.min(1,Number(a?.ownTrust)||0)),u=a?.sourceType||"",d=Math.max(0,Math.min(1,l*c)),p=o.get(u)||{complement:1,strongest:0};p.complement*=1-d,p.strongest=Math.max(p.strongest,d),o.set(u,p),r.push({sourceId:a?.sourceId||"",sourceType:u,ownTrust:l,recency:ar(c)})}let i=1;for(let[a,c]of o){let l=Math.max(Aj(a),c.strongest);i*=1-Math.min(1-c.complement,l)}return{score:s.length?ar(Math.min(1,1-i)):0,inputs:r}}function $h(e){return ja(e,{halfLifeMs:Cj})}function vh({factsAsserted:e=0,factsContradicted:t=0}={}){let n=Math.max(0,Number(e)||0),s=Math.max(0,Number(t)||0),o=Math.max(-1,Math.min(1,(n-2*s)/Math.max(1,n))),r=n/(n+Ij),i=(o*r+1)/2;return ar(mu+(gh-mu)*i)}var cr,Ea,lt,Ks,dh,fh,kj,Rj,ws,hu,hh,_j,ph,mu,gh,mh,ar,Tj,Cj,Ij,Mn=M(()=>{cr="mgx:trustScore",Ea="mgx:trustInputs",lt="mgx:createdAt",Ks="mgx:updatedAt";dh="#node:",fh="peer:";kj="wikipedia-live",Rj=e=>e===kj?"referenceLive":"reference";ws=Object.freeze({operator:1,teach:.95,provider:.9,corpus:.7,reference:.6,corpusWeak:.55,referenceLive:.5,extracted:.45,web:.4,optimisticExtract:.35,entailed:.3}),hu=Object.freeze({operator:{subClass:"tmct:AgentSource",prov:"prov:Agent"},teach:{subClass:"tmct:AgentSource",prov:"prov:Agent"},provider:{subClass:"tmct:AgentSource",prov:"prov:Agent"},corpus:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},corpusWeak:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},reference:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},referenceLive:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},web:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},extracted:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},optimisticExtract:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},entailed:{subClass:"tmct:ActivitySource",prov:"prov:Activity"}}),hh=new Set(Object.entries(hu).filter(([,e])=>e.prov==="prov:Agent").map(([e])=>e)),_j=720*60*60*1e3,ph=.9,mu=.5,gh=1.5,mh=1,ar=(e,t=6)=>Number(e.toFixed(t)),Tj=e=>(e?.attributes||[]).find(t=>t.prop==="mgx:sourceType")?.value||"";Cj=1/0;Ij=19});var xo,gu=M(()=>{xo=e=>/(^|\/)tests?\//.test(e)||/(^|\/)test_[^/]*\.py$/.test(e)||/\.tests(\.|$)/.test(e)||/(^|\/)[^/]*[-_]tests?\//.test(e)||/\.(test|spec)\.[cm]?[jt]sx?$/.test(e)});function bu(e,t){return Math.log(1+e/(1+t))}var si=M(()=>{});var Ra={};Nt(Ra,{bfsLevels:()=>ka,findActionPath:()=>oi,findReachableSet:()=>wu});function xh(e){return e&&typeof e=="object"?JSON.stringify(e):String(e)}function Eh(e,t){let n=[];for(let{action:s,nextState:o}of t(e)||[])n.push({state:o,actions:[s],states:[e,o]});return n}function oi(e,t,n,{maxDepth:s=50,stateKey:o=xh}={}){if(t(e))return{actions:[],states:[e]};let r=Eh(e,n),i=new Set([o(e)]);for(let a=1;a<=s&&r.length;a+=1){for(let l of r)if(t(l.state))return{actions:l.actions,states:l.states};if(a===s)break;let c=[];for(let l of r){let u=o(l.state);if(!i.has(u)){i.add(u);for(let{action:d,nextState:p}of n(l.state)||[]){let f=o(p);i.has(f)||c.push({state:p,actions:[...l.actions,d],states:[...l.states,p]})}}}r=c}return null}function wu(e,t,{maxDepth:n=50,stateKey:s=xh}={}){let o=Eh(e,t),r=new Set([s(e)]),i=[];for(let a=1;a<=n&&o.length;a+=1){let c=[];for(let l of o){let u=s(l.state);if(!r.has(u)&&(r.add(u),i.push({node:l.state,path:{actions:l.actions,states:l.states}}),a!==n))for(let{action:d,nextState:p}of t(l.state)||[]){let f=s(p);r.has(f)||c.push({state:p,actions:[...l.actions,d],states:[...l.states,p]})}}o=c}return i}function*ka(e,t,{maxDepth:n=8,keyOf:s=o=>o}={}){let o=new Set([e]),r=[e];for(let i=1;i<=n&&r.length;i+=1){let a=[],c=[];for(let l of r)for(let u of t(l)||[]){let d=s(u);o.has(d)||(o.add(d),a.push(u),c.push(d))}r=c,yield a}}var ys=M(()=>{});function Ta(e){let t=Array.isArray(e?.individuals)?e.individuals:[],n=new Map;for(let r of t)r&&r.id&&n.set(r.id,r);let s=(Array.isArray(e?.objectProperties)?e.objectProperties:[]).filter(r=>r&&(r.predicate||r.prop)).map(r=>{let i=(Array.isArray(r.examples)?r.examples:[]).filter(a=>a&&a.subject&&a.object);return{predicate:String(r.predicate||""),prop:r.prop||null,count:Number(r.count)||i.length,edges:i}}),o=s.filter(r=>r.count>r.edges.length).map(r=>({predicate:r.predicate,count:r.count,shown:r.edges.length}));return{individuals:t,byId:n,relations:s,truncated:o,generatedAt:e?.generated_at||null,proseIndex:e?.proseIndex||{}}}function ri(e){return!e||!Array.isArray(e.individuals)?0:e.individuals.filter(t=>(t.class||"")==="Module").length}function xs(e){let t=String(e?.prop||"").toLowerCase();if(Sh[t])return Sh[t];let n=String(e?.predicate||"").toLowerCase();if(/symbol/.test(n)){if(/\b(call|invoke)/.test(n))return"callsSymbol";if(/(touch|chang|modif)/.test(n))return"touchesSymbol"}return/\bimport/.test(n)?"imports":/\b(call|invoke)/.test(n)?"calls":/\b(define|export|declare)/.test(n)?"defines":/\b(test|cover)/.test(n)?"tests":/\b(touch|chang|modif)/.test(n)?"touches":/\bcontain/.test(n)?"contains":/\b(inherit|subclass|extend|specializ)/.test(n)?"inherits":/denot/.test(n)?"denotes":/\bserve/.test(n)?"serves":null}function En(e){return String(e||"").trim().toLowerCase().replace(/^\.\//,"").replace(/^\//,"")}function yu(e){let t=En(e).split("/");return t[t.length-1]}function Oj(e){return(e?.derived_from||[]).filter(Mh).length}function jh(e){return(e?.mentions||[]).reduce((n,s)=>n+(Number(s?.count)||0),0)+Oj(e)}function hn(e,t){let n=En(t);if(!n)return{match:null,candidates:[]};let s=yu(n),o=!n.includes("/"),r=[];for(let i of e.individuals){let a=En(i.label),c=String(i.id||"").toLowerCase(),l=0;a===n||c===n?l=100:a.endsWith(`/${n}`)||o&&(yu(a)===s||yu(a).replace(/\.[a-z]+$/,"")===s)?l=80:a.includes(n)&&(l=Math.max(10,50-(a.length-n.length))),l>0&&r.push({ind:i,score:l})}return r.sort((i,a)=>a.score-i.score||jh(a.ind)-jh(i.ind)||String(i.ind.label).length-String(a.ind.label).length),{match:r[0]?.ind||null,candidates:r.slice(1,5).map(i=>i.ind)}}function Vt(e){let t=(e?.attributes||[]).find(s=>s.key==="site");if(!t)return null;let n=String(t.value).match(/^(.*):(\d+)(?:-(\d+))?$/);return n?{path:n[1],start:Number(n[2]),end:n[3]?Number(n[3]):Number(n[2])}:null}function Nj(e,t){let n=[],s=[];for(let o of e.relations){let r=o.edges.filter(a=>a.subject===t),i=o.edges.filter(a=>a.object===t);r.length&&n.push({group:o,edges:r}),i.length&&s.push({group:o,edges:i})}return{out:n,incoming:s}}function kh(e){return e.prop?`${e.predicate} [${e.prop}]`:e.predicate}function vs(e){let t=e||"Entity",n=Yn(t);return n.length<2?t:n.map(s=>s[0].toUpperCase()+s.slice(1)).join(" ")}function vt(e,t,n=", "){return e.length<=t?e.join(n):e.slice(0,t).join(n)+`, +${e.length-t} more`}function ju(e,t,{candidates:n=[]}={}){let s=[];s.push(`${t.label} \u2014 ${vs(t.class)} (id: ${t.id})`);let o=(t.derived_from||[]).filter(Mh);o.length&&s.push(`attestation: ${o.length} provenance ref(s)`);for(let c of t.attributes||[])s.push(`attribute: ${c.key} = ${c.value}${c.prop?` [${c.prop}]`:""}`);let{out:r,incoming:i}=Nj(e,t.id);if(!r.length&&!i.length)s.push("edges: none in the current artifact");else{s.push("edges:");for(let{group:c,edges:l}of r)s.push(` ${kh(c)} (${l.length}) \u2192 ${vt(l.map(u=>u.objectLabel||u.object),Rh)}`);for(let{group:c,edges:l}of i)s.push(` \u2190 ${kh(c)} (${l.length}) by ${vt(l.map(u=>u.subjectLabel||u.subject),Rh)}`)}let a=t.derived_from||[];return a.length&&s.push(`provenance: ${vt(a,Lj)}`),n.length&&s.push(`other matches: ${n.map(c=>`${c.label} (${vs(c.class)})`).join(", ")}`),e.truncated.length&&s.push(Pj(e)),s.join(`
2
- `)}function Pj(e){return`note: partial edge lists for: ${e.truncated.map(n=>`${n.predicate} (${n.shown}/${n.count})`).join(", ")}. Counts are complete; the lists are not.`}function ur(e,t,{maxDepth:n=8}={}){let s=new Map,o=new Map,r=(a,c,l,u)=>{!a||!c||a===c||(s.has(a)||s.set(a,[]),s.get(a).push({id:c,label:l,via:u}))};for(let a of e.relations){let c=xs(a);if(c==="imports"||c==="calls")for(let l of a.edges)r(l.object,l.subject,l.subjectLabel||l.subject,a.predicate);else if(c==="callsSymbol")for(let l of a.edges){let u=$s(e,l.subject),d=$s(e,l.object);if(!u||!d)continue;let p=e.byId.get(u)?.label||u;r(d,u,p,a.predicate),u!==d&&r(l.object,u,p,a.predicate)}else if(c==="tests")for(let l of a.edges)o.has(l.object)||o.set(l.object,[]),o.get(l.object).push(l.subjectLabel||l.subject);else if(c==="serves")for(let l of a.edges)r(l.subject,l.object,l.objectLabel||l.object,a.predicate)}let i=[];for(let a of ka(t.id,c=>s.get(c)||[],{maxDepth:n,keyOf:c=>c.id})){if(!a.length)continue;let c=a.map(l=>({...l,tests:o.get(l.id)||[]})).sort((l,u)=>String(l.label).localeCompare(String(u.label)));i.push(c)}return i}function Fh(e,t,{maxDepth:n=8}={}){let s=ur(e,t,{maxDepth:n}),o=[`Impact of changing ${t.label} (reverse closure over imports/calls edges, module- and function-level):`];s.length||o.push("no dependents found in the current artifact \u2014 nothing imports or calls it (or its edges are not in the extracted graph yet).");let r=s.reduce((a,c)=>a+c.length,0);s.length&&o.push(`total: ${r} dependent(s) across ${s.length} depth level(s) (lists capped for brevity).`),s.forEach((a,c)=>{if(c>=Mj){o.push(`depth ${c+1}: ${a.length} more dependent(s) (not listed)`);return}o.push(c===0?`depth 1 (${a.length} direct dependents):`:`depth ${c+1} (${a.length}):`);for(let l of a.slice(0,$u)){let u=l.tests.length?`tests: ${vt(l.tests,Fj)}`:"tests: none recorded",d=c===0?`${l.via} it`:"reaches it through an intermediary";o.push(` - ${l.label} (${d}) \u2014 ${u}`)}a.length>$u&&o.push(` \u2026+${a.length-$u} more at depth ${c+1}`)});let i=e.truncated.filter(a=>{let c=xs({predicate:a.predicate});return c==="imports"||c==="calls"||c==="callsSymbol"||c==="tests"||c==="serves"});return i.length&&o.push("warning: partial edge lists ("+i.map(a=>`${a.predicate}: ${a.shown}/${a.count}`).join(", ")+") \u2014 this closure may be missing edges. Cross-check critical results with a lexical search (/find <term>)."),o.join(`
3
- `)}function Dh(e){let t=new Map;for(let n of e.relations)if(xs(n)==="defines")for(let s of n.edges)t.has(s.subject)||t.set(s.subject,[]),t.get(s.subject).push(s.objectLabel||s.object);return t}function Th(e){return new Set(String(e).replace(/([a-z0-9])([A-Z])/g,"$1_$2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean))}function Gh(e,t,n=null){let s=n||(i=>$s(e,i)),o=new Map,r=(i,a)=>{!i||!a||i===a||(o.has(i)||o.set(i,new Set),o.has(a)||o.set(a,new Set),o.get(i).add(a),o.get(a).add(i))};for(let i of t)for(let a of _e(e,i))r(s(a.subject),s(a.object));return o}function $k(e,t,n){if(t.length<2)return;let s=new Map(t.map(l=>[l.ind.id,l])),o=new Map(t.map(l=>[l.ind.id,l.score])),r=l=>{if(!l.size)return[[],[]];let u=0;for(let m of l.values())u=Math.max(u,m);let d=[...l.entries()].sort((m,h)=>h[1]-m[1]),p=[],f=[];for(let[m,h]of d)h>=u*uk&&p.length<n?p.push([m,h]):f.length<_h&&f.push([m,h]);return[p,f]},[i,a]=r(new Map(t.map(l=>[l.ind.id,l.score]))),c=new Set(i.map(([l])=>l));for(let l=0;l<pk&&i.length;l++){let u=new Map,d=[];for(let p of mk){let f=Gh(e,p),m=new Map;for(let[b,y]of i)for(let $ of f.get(b)||[])o.has($)&&m.set($,Math.max(m.get($)||0,y));let[h,g]=r(m);for(let[b,y]of h)u.set(b,Math.max(u.get(b)||0,y));d.push(...g)}a.push(...d);for(let[p,f]of u){if(c.has(p))continue;let m=s.get(p);m&&(m.score+=Math.min(f*dk,m.score*fk),c.add(p))}i=[...u.entries()],!i.length&&a.length&&(i=a.splice(0,_h).filter(([p])=>!c.has(p)))}}function vk(e,t=[],{depth:n=Uh,q:s=Wh,nodeLimit:o=Bh,kinds:r=hk,classPredicate:i=u=>(u.class||"")==="Module",idNormalizer:a=null,seeds:c=null,hubDegree:l=1/0}={}){let u=new Map(t.map(x=>[x.ind.id,x])),d=0;for(let x of t)d=Math.max(d,x.score);let p=t.length>0&&d>0,f=new Set(c??u.keys());if(!f.size)return[];let m=Gh(e,r,a),h=x=>m.get(x)?.size||0,g=[],b=(x,R)=>x.hop!==R.hop?x.hop<R.hop:x.deg!==R.deg?x.deg<R.deg:x.id<R.id,y=(x,R)=>{let w=g[x];g[x]=g[R],g[R]=w},$=x=>{g.push(x);let R=g.length-1;for(;R>0;){let w=R-1>>1;if(b(g[R],g[w]))y(R,w),R=w;else break}},E=()=>{let x=g[0],R=g.pop();if(g.length){g[0]=R;let w=0;for(;;){let T=2*w+1,I=2*w+2,j=w;if(T<g.length&&b(g[T],g[j])&&(j=T),I<g.length&&b(g[I],g[j])&&(j=I),j===w)break;y(w,j),w=j}}return x},_=new Set(f);for(let x of f)$({id:x,hop:0,deg:h(x)});let v=null,S=0,C=[];for(;g.length&&S<o;){let x=E();if(C.push({id:x.id,hop:x.hop}),!f.has(x.id)){if(p){let T=d*gk*Math.pow(bk,x.hop-1),I=u.get(x.id);if(I)I.score+=Math.min(T*wk,I.score*yk);else{let j=e.byId?.get?.(x.id);if(j&&i(j)){v||(v=Dh(e));let k=v.get(j.id)||[],P={ind:j,score:T,defineCount:k.length,matching:[],density:0};t.push(P),u.set(x.id,P)}}}S++}if(x.hop>=n||x.hop>0&&h(x.id)>l)continue;let R=[];for(let T of m.get(x.id)||[]){if(_.has(T))continue;let I=e.byId?.get?.(T);!I||!i(I)||R.push({id:T,deg:h(T)})}if(!R.length)continue;R.sort((T,I)=>T.deg-I.deg||(T.id<I.id?-1:T.id>I.id?1:0));let w=Math.max(1,Math.floor(s*R.length));for(let T=0;T<w;T++){let I=R[T];_.add(I.id),$({id:I.id,hop:x.hop+1,deg:I.deg})}}return C}function Vh(e,t,n={}){let{demoteNonProd:s=!1,callAdjacency:o=!1,implOfInterface:r=!1,beamSearch:i=!1,spiral:a=!1,proseBoost:c=!1,proseLayers:l=!1,literalMention:u=!1,rawQuery:d=""}=n,p=Number.isFinite(n.beamWidth)&&n.beamWidth>0?n.beamWidth:8,f=Dh(e),m=[];for(let E of e.individuals){if((E.class||"")!=="Module")continue;let _=String(E.label),v=_.toLowerCase(),S=f.get(E.id)||[],C=new Set(S.map(w=>w.toLowerCase())),x=new Set;for(let w of S)for(let T of Th(w))x.add(T);let R=u?String((E.attributes||[]).find(w=>w.key==="dotted")?.value||"").toLowerCase():"";m.push({ind:E,label:_,labelLc:v,defines:S,symSet:C,symComps:x,dotted:R})}let h=m.length||1,g=new Map,b=E=>{let _=0;for(let v of m)(v.labelLc.includes(E)||v.symComps.has(E)||v.symSet.has(E))&&_++;return _},y=E=>(g.has(E)||g.set(E,bu(h,b(E))),g.get(E));for(let E of t)y(E);let $=[];for(let E of m){let _=0,v=0,S=0,C=[];for(let I of t){let j=g.get(I)||0;j&&(E.symSet.has(I)?(_+=j*zh,S++):E.symComps.has(I)&&(C.push(j),S++),E.labelLc.includes(I)&&(v+=j*zj))}C.sort((I,j)=>j-I);let x=0;for(let I=0;I<Math.min(C.length,Bj);I++)x+=C[I]*Uj;let R=_+v+x;if(!R)continue;s&&(xo(E.labelLc)||Hj(E.labelLc))?R*=Vj:xo(E.labelLc)&&(R*=.4);let w=E.defines.filter(I=>{let j=I.toLowerCase(),k=Th(I);return t.some(P=>j===P||k.has(P))}),T=E.defines.length?S/E.defines.length:0;$.push({ind:E.ind,score:R,defineCount:E.defines.length,matching:w,density:T})}if(u&&d&&$.length){let E=String(d).toLowerCase(),_=x=>x!=null&&/[a-z0-9_./]/.test(x),v=x=>{for(let R=E.indexOf(x);R!==-1;R=E.indexOf(x,R+1))if(!_(E[R-1])&&!_(E[R+x.length]))return!0;return!1},S=new Map(m.map(x=>[x.ind.id,x])),C=0;for(let x of $)C=Math.max(C,x.score);for(let x of $){let R=S.get(x.ind.id);if(!R)continue;let w=0;for(let T of new Set([R.dotted,R.labelLc])){if(!T||T.split(/[./]+/).filter(Boolean).length<ik||!v(T))continue;let I=[...new Set(T.split(/[^a-z0-9_]+/).filter(Boolean))].map(y).sort((k,P)=>P-k),j=0;for(let k=0;k<Math.min(I.length,ak);k++)j+=I[k]*rk;w=Math.max(w,j)}w&&(x.score+=Math.min(w*ck,C*lk))}}if($.length>1){let E=new Map($.map(v=>[v.ind.id,v.score])),_=new Map;for(let v of _e(e,"imports"))!E.has(v.subject)&&!E.has(v.object)||(_.has(v.subject)||_.set(v.subject,new Set),_.has(v.object)||_.set(v.object,new Set),_.get(v.subject).add(v.object),_.get(v.object).add(v.subject));for(let v of $){let S=0;for(let C of _.get(v.ind.id)||[])S=Math.max(S,E.get(C)||0);v.score+=Math.min(S*Wj,v.score*Gj)}}if(o&&$.length>1){let E=new Map($.map(v=>[v.ind.id,v.score])),_=new Map;for(let v of["calls","callsSymbol"])for(let S of _e(e,v)){let C=$s(e,S.subject),x=$s(e,S.object);!C||!x||C===x||!E.has(C)&&!E.has(x)||(_.has(C)||_.set(C,new Set),_.has(x)||_.set(x,new Set),_.get(C).add(x),_.get(x).add(C))}for(let v of $){let S=0;for(let C of _.get(v.ind.id)||[])S=Math.max(S,E.get(C)||0);v.score+=Math.min(S*qj,v.score*Kj)}}if(r&&$.length>1){let E=new Map($.map(v=>[v.ind.id,v.score])),_=new Map;for(let v of e.individuals)(v.class||"")==="Class"&&v.label&&_.set(String(v.label),v);for(let v of $){if(!Jj(v.ind.label))continue;let S=0;for(let C of _e(e,"inherits")){if($s(e,C.subject)!==v.ind.id||!Qj(C.objectLabel))continue;let R=$s(e,C.object);if(!R){let w=_.get(String(C.objectLabel||""));w&&(R=Xn(e,w))}R&&(S=Math.max(S,E.get(R)||0))}v.score+=Math.min(S*Yj,v.score*Xj)}}if(c&&$.length&&e.proseIndex){let E=vo(e.proseIndex,t.join(" "),{limit:tk});if(E.length){let _=new Map;for(let{id:v,score:S}of E){let C=$s(e,v);C&&_.set(C,(_.get(C)||0)+S)}for(let v of $){let S=_.get(v.ind.id)||0;S&&(v.score+=Math.min(S*Zj,v.score*ek))}}}if(l&&$.length&&e.proseIndex){let E=new Map($.map(S=>[S.ind.id,S])),_=new Map(m.map(S=>[S.ind.id,S])),v=new Map;for(let S of new Set(t)){let C=g.get(S)||0;if(!C)continue;let{ids:x}=lh(e.proseIndex,S);if(!x.length)continue;let R=new Set;for(let w of x){let T=$s(e,w);if(!T||R.has(T)||(R.add(T),!E.has(T)))continue;let I=_.get(T);I&&(I.symSet.has(S)||I.symComps.has(S)||I.labelLc.includes(S))||v.set(T,(v.get(T)||0)+C*ok)}}for(let S of $){let C=v.get(S.ind.id)||0;C&&(S.score+=Math.min(C*nk,S.score*sk))}}return i&&$.length>1&&$k(e,$,p),a&&$.length&&vk(e,$,{depth:Number.isFinite(n.spiralDepth)&&n.spiralDepth>0?n.spiralDepth:Uh,q:Number.isFinite(n.mostDistinctiveBeams)&&n.mostDistinctiveBeams>0?n.mostDistinctiveBeams:Wh,nodeLimit:Number.isFinite(n.spiralNodeLimit)&&n.spiralNodeLimit>0?n.spiralNodeLimit:Bh}),$.sort((E,_)=>_.score-E.score||_.density-E.density||E.defineCount-_.defineCount||String(E.ind.label).length-String(_.ind.label).length),$}function Hh(e,t,n={}){let s=String(t||""),o=s.toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean);if(!o.length)return[];let r=n.literalMention?{...n,rawQuery:s}:n;return Vh(e,o,r).map(i=>({path:String(i.ind.label),score:i.score}))}function Ek(e){let t=0,n=!1,s=!1,o=!1,r="",i=!1,a=()=>{t+=1,r===")"&&(n=!0),i=!0};for(let c=0;c<e.length;c++){let l=e[c];if(l==="\\"){let u=e[c+1]||"";!o&&u>="1"&&u<="9"&&(s=!0),c+=1,r="",i=!1;continue}if(o){l==="]"&&(o=!1,r="]",i=!1);continue}if(l==="["){o=!0,r="[",i=!1;continue}if(l==="?"&&(r==="("||i)){r="?",i=!1;continue}if(l==="*"||l==="+"||l==="?"){a(),r=l;continue}if(l==="{"){let u=e.indexOf("}",c),d=u===-1?"":e.slice(c+1,u);if(u!==-1&&/^\d+(,\d*)?$/.test(d)){a(),c=u,r="}";continue}r="{",i=!1;continue}r=l,i=!1}return{quantifiers:t,quantifiedGroup:n,backreference:s}}function ku(e,{now:t=Date.now}={}){let n=String(e);if(n.length>Ah)return{error:`name pattern is ${n.length} characters; the limit is ${Ah}.`};let{quantifiers:s,quantifiedGroup:o,backreference:r}=Ek(n);if(o)return{error:`name pattern "${n}" quantifies a group, which can backtrack for minutes on one label. Quantify a character or a class instead.`};if(r)return{error:`name pattern "${n}" uses a back-reference, which can backtrack for minutes on one label.`};if(s>Ch)return{error:`name pattern "${n}" has ${s} quantifiers; the limit is ${Ch}.`};let i;try{i=new RegExp(n,"i")}catch{return{error:`invalid name pattern: ${n}`}}let a=null;return{test(c){if(a===null)a=t()+Ih;else if(t()>a)throw new _a(`name pattern "${n}" exceeded its ${Ih}ms matching budget.`);return i.test(String(c).slice(0,xk))}}}function qh(e,t,{limit:n=Aa,kind:s="",decorator:o="",name:r="",toolNamePrefix:i="tmct_"}={}){let a=String(t||"").toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean),c=String(s||"").trim().toLowerCase(),l=String(o||"").trim().toLowerCase(),u=null;if(r){let m=ku(r);if(m.error)return m.error;u=m}if(c&&c!=="module")try{return _k(e,a,{limit:n,kind:c,decFilter:l,nameRe:u,toolNamePrefix:i})}catch(m){if(m instanceof _a)return m.message;throw m}if(!a.length&&!u&&!l)return"empty query";let d=Vh(e,a);if(!d.length)return`no module matches "${t}". Try broader keywords, or ${i}describe <path> if you know where it lives.`;let p=d.slice(0,n),f=[`${d.length} module(s) match "${t}" (top ${p.length}):`];for(let{ind:m,defineCount:h,matching:g}of p){let b=g.length?` \u2014 matching: ${vt([...new Set(g)],Dj)}`:"";f.push(`- ${m.label} (defines ${h} symbol(s))${b}`)}return f.push(`Then ${i}describe <path> for the full sibling list + typed edges, or ${i}impact <path> for dependents.`),f.join(`
4
- `)}function _e(e,t){let n=Oh.get(e);n||(n=new Map,Oh.set(e,n));let s=n.get(t);if(s)return s;let o=[];for(let r of e.relations)if(xs(r)===t)for(let i of r.edges)o.push(i);return n.set(t,o),o}function $s(e,t){let n=e.byId?.get?.(t);if(n)return Xn(e,n);let s=String(t||"").match(/^fn:(.+)#/);return s?`mod:${s[1]}`:null}function Xn(e,t){if((t?.class||"")==="Module")return t.id;let n=Vt(t);if(n)return`mod:${n.path}`;let s=String(t?.id||"").match(/^fn:(.+)#/);return s?`mod:${s[1]}`:null}function Ru(e){if(!e)return"";let t=e.end>e.start?`${e.start}-${e.end}`:`${e.start}`;return` [${e.path}:${t}]`}function lr(e){return(e?.attributes||[]).find(t=>t.key==="decorators")?.value||""}function Kh(e,t,{toolNamePrefix:n="tmct_"}={}){let s=[`${t.label} \u2014 ${vs(t.class)} (id: ${t.id})`],o=_e(e,"contains").filter(a=>a.subject===t.id);if(!o.length)return s.push(`members: none recorded (empty class, or members not in the extracted graph). Use ${n}describe for its edges.`),s.join(`
5
- `);let r=[],i=[];for(let a of o){let c=e.byId.get(a.object),l=Ru(c?Vt(c):null),u=c?lr(c):"",d=`${a.objectLabel||a.object}${l}${u?` @${u}`:""}`;((c?.class||"")==="Attribute"?i:r).push(d)}return r.length&&s.push(`methods (${r.length}): ${vt(r,Nh)}`),i.length&&s.push(`attributes (${i.length}): ${vt(i,Nh)}`),s.push(`Use ${n}snippet <Class.member> for an exact body.`),s.join(`
6
- `)}function Yh(e,t,{toolNamePrefix:n="tmct_"}={}){let s=Vt(t),o=[`${t.label} \u2014 ${vs(t.class)}${Ru(s)}`],r=He(t,"params"),i=He(t,"returns");(r||i||(t.class||"")==="Method"||(t.class||"")==="Function")&&o.push(`signature: ${t.label}(${r})${i?` -> ${i}`:""}`);let a=[];He(t,"isStatic")&&a.push("static"),He(t,"isAbstract")&&a.push("abstract"),He(t,"isConstant")&&a.push("constant");let c=He(t,"visibility");c&&a.push(c),a.length&&o.push(`flags: ${a.join(", ")}`);let l=lr(t);l&&o.push(`decorators: @${l.split(", ").join(", @")}`);let u=He(t,"raises");u&&o.push(`raises: ${u}`);let d=He(t,"catches");d&&o.push(`catches: ${d}`);let p=He(t,"self_fields");p&&o.push(`self fields: ${p}`);let f=He(t,"value");f&&o.push(`value: ${f}`);let m=He(t,"doc");return m&&o.push(`doc: ${m}`),o.length===1&&o.push(`(no signature detail recorded for this symbol \u2014 likely a module or attribute; use ${n}snippet for its source.)`),o.push(`Use ${n}snippet for the exact body.`),o.join(`
7
- `)}function Xh(e,t){let n=_e(e,"inherits"),s=n.filter(c=>c.subject===t.id).map(c=>c.objectLabel||c.object),o=new Map;for(let c of n)o.has(c.object)||o.set(c.object,[]),o.get(c.object).push({id:c.subject,label:c.subjectLabel||c.subject});let r=[`${t.label} \u2014 ${vs(t.class)} (id: ${t.id})`];r.push(s.length?`extends: ${vt(s,Lh)}`:"extends: (no internal/recorded base classes)");let i=[];for(let c of ka(t.id,l=>o.get(l)||[],{maxDepth:8,keyOf:l=>l.id}))c.length&&i.push(c.map(l=>l.label).sort((l,u)=>String(l).localeCompare(String(u))));let a=i.reduce((c,l)=>c+l.length,0);return a?(r.push(`subclasses: ${a} total across ${i.length} level(s).`),i.forEach((c,l)=>r.push(` depth ${l+1} (${c.length}): ${vt(c,Lh)}`))):r.push("subclasses: none recorded \u2014 nothing extends it in the extracted graph."),r.join(`
8
- `)}function Ca(e){let t=new Map;for(let n of e){let s=n.label.includes("/")?n.label.slice(0,n.label.lastIndexOf("/")):"(root)";t.set(s,(t.get(s)||0)+1)}return t}function Ia(e,t=""){let n=En(t);return e.individuals.filter(s=>(s.class||"")==="Module"&&(!n||En(s.label).startsWith(n)))}function Jh(e,{pkg:t=""}={}){let n=En(t),s=Ia(e,t);if(!s.length)return n?`no modules under "${t}".`:"no modules in the graph.";let o=Ca(s),r=new Map;for(let u of _e(e,"imports"))r.set(u.object,(r.get(u.object)||0)+1);let i=new Set(s.map(u=>u.id)),a=[...r.entries()].filter(([u])=>i.has(u)).sort((u,d)=>d[1]-u[1]).slice(0,jk).map(([u,d])=>`${e.byId.get(u)?.label||u} (${d} importers)`),c=[...o.entries()].sort((u,d)=>d[1]-u[1]),l=[`Architecture${n?` of ${t}`:""}: ${s.length} module(s) in ${c.length} package(s).`];return l.push(`packages (by module count): ${vt(c.map(([u,d])=>`${u} (${d})`),Sk)}`),l.push(a.length?`hub modules (most imported): ${a.join(", ")}`:"hub modules: none (no internal imports recorded)."),l.join(`
9
- `)}function Zh(e,t){let n=Xn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||Vt(t)?.path||n,o=[...new Set(_e(e,"tests").filter(a=>a.object===n).map(a=>a.subjectLabel||a.subject))],r=o.length>0,i=r?`covered by ${o.length} test module(s):
10
- ${vt(o,Qh,`
1
+ (()=>{var rj=Object.defineProperty;var M=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(s){throw n=[s],s}};var Lt=(e,t)=>{for(var n in t)rj(e,n,{get:t[n],enumerable:!0})};var yt,zF,UF,BF,WF,GF,VF,HF,qF,KF,YF,XF,JF,QF,ZF,eD,tD,ne,ye,Gt,ru,Bm,nD,sD,oD,Je=M(()=>{yt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},zF=yt("createRequire"),UF=yt("readFileSync"),BF=yt("access"),WF=yt("readFile"),GF=yt("writeFile"),VF=yt("appendFile"),HF=yt("mkdir"),qF=yt("mkdtemp"),KF=yt("rename"),YF=yt("unlink"),XF=yt("rm"),JF=yt("stat"),QF=yt("copyFile"),ZF=yt("readdir"),eD=yt("createReadStream"),tD=yt("createWriteStream"),ne=(...e)=>e.join("/"),ye=e=>String(e).replace(/\/[^/]*$/,""),Gt=(...e)=>e.join("/"),ru=e=>String(e).startsWith("/"),Bm="/",nD=yt("randomBytes"),sD=yt("spawnSync"),oD=yt("createInterface")});var $t,iD,aD,iu,Ie,tr,ij,Vn,Wm,wa,au,Gm,aj,cD,cj,lD,uD,dD,fD,pD,Pt=M(()=>{$t=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},iD=$t("createRequire"),aD=$t("readFileSync"),iu=$t("access"),Ie=$t("readFile"),tr=$t("writeFile"),ij=$t("appendFile"),Vn=$t("mkdir"),Wm=$t("mkdtemp"),wa=$t("rename"),au=$t("unlink"),Gm=$t("rm"),aj=$t("stat"),cD=$t("copyFile"),cj=$t("readdir"),lD=$t("createReadStream"),uD=$t("createWriteStream"),dD=$t("randomBytes"),fD=$t("spawnSync"),pD=$t("createInterface")});function nr(e){let t=dj.exec(String(e||""));return t?t[1].toLowerCase():null}function Ws(e,t){return!e||!fj.has(t)?e:e.shape==="ask"?{...e,subject:e.object,object:e.subject}:e.shape==="reverse"?{...e,shape:"forward"}:e.shape==="forward"?{...e,shape:"reverse"}:e}function ya(e){return String(e||"").replace(pj,"$1")}function Gs(e){return e.replace(mj,"").trim()}function pn(e){let t=e;for(let n=0;n<2;n+=1){let s=t.replace(gj,"").trim();if(s=s.replace(wj,"").trim(),s===t)break;t=s}return t}var Vm,Hm,lj,Jr,bo,qm,Km,uj,dj,Ym,fj,fn,cu,pj,Mn,lu,mj,hj,gj,bj,wj,me,Qr,$a,yj,Xm,Ze,mn,Vs,va,uu,du,fu,Jm,Zr,wo,Qm,Zm,yo,En,bs,sr,ct,eh,$o,vo,Hn,qn,th,ei,or,xa,rr,nh,Kn=M(()=>{Vm=["is a superclass of","are a superclass of","is a parent class of","are a parent class of","superclass","superclasses"],Hm=["belongs to","belong to","is part of","are part of","is defined in","are defined in"],lj=["lives in","live in","sits in","sit in","sits inside","sit inside"],Jr={imports:{bare:"import",comment:"Module -> Module: subject's import graph references object (usesComplexType).",verbs:["couples to","couple to","depends on","imports","import","relies on","rely on","requires","require","references","reference","pulls in","pull in","built on","builds on","build on","uses code from","grabs","grab","pulls from","pull from","leans on","lean on","is wired to","are wired to","is hooked up to","are hooked up to","importing"]},uses:{bare:"use",comment:"query-side union: imports (Module->Module) + calls (Module->Module) + callsSymbol (fn->fn).",verbs:["uses","use","makes use of","make use of","talks to","talk to","using"]},calls:{bare:"call",comment:"Function/Method -> Function/Class (symbol-grain) or Module -> Module (coarse): subject invokes object.",verbs:["invokes","invoke","calls","call","runs","run","executes","execute","hits","hit","triggers","trigger","fires","fire","kicks off","kick off","calling"]},defines:{bare:"define",comment:"Module -> top-level Function/Class/Method/Attribute: subject declares object.",verbs:["defines","define","declares","declare","has","have","holds","hold","defining"]},contains:{bare:"contain",comment:"Class -> Method/Attribute: subject's membership includes object.",verbs:["contains","contain","containing",...Hm,...lj]},tests:{bare:"test",comment:"Module -> Module: subject is a test module importing/covering object.",verbs:["tests","test","covers","cover","verifies","verify","exercises","exercise","checks","check","makes sure of","make sure of","testing"]},inherits:{bare:"inherit from",comment:"Class -> Class: subject's declared base resolves to object (subclassOf).",verbs:["inherits from","inherit from","inherits","inherit","extends","extend","subclasses","subclass","derives from","derive from","is a subclass of","are a subclass of","is a kind of","are a kind of","is built off","are built off","is built on top of","are built on top of","extending","inheriting from","inheriting","subclassing","extends from",...Vm]},touches:{bare:"touch",comment:"Commit -> Module (coarse) or Commit -> symbol (fine, touchesSymbol): a commit's changed-line-range intersects object.",verbs:["touched","touches","changed","change","modified","modifies","was changed in","were changed in","was edited in","were edited in","was modified by","were modified by","was tweaked in","were tweaked in","got changed in","got edited in","touch","changed in","landed in","land in","was in","were in","went into","included in","updated","edited","touching"]},cochange:{bare:"co-change with",comment:"Module -> Module: subject and object are frequently committed together (changeCoupledWith).",verbs:["changed with","co-changes with","co-change with","changes alongside","change alongside","shares commits with","share commits with","tends to change together with","tend to change together with","moves together with","move together with","changed together with","change together with","changes together with","changes with","change with","tends to change with","tend to change with","usually changes with"]},reexports:{bare:"re-export",comment:"Module -> exported symbol: subject's public API surface (__all__/export list).",verbs:["exports","export","re-exports","re-export","passes through","pass through","exposes","expose","exporting"]},serves:{bare:"serve",comment:"subject provides or backs the object \u2014 a handler serving a route, a module serving a surface (mgx:serves).",verbs:["serves","serve","serving"]},denotes:{bare:"denote",comment:"subject names the object \u2014 a glossary/lexicon term denoting a code entity (mgx:denotes).",verbs:["denotes","denote","denoting"]}},bo=Object.freeze({placement:Object.freeze({predicate:"mgx:currently-in",comment:"individual -> place: where the subject is right now.",nouns:Object.freeze(["location","locations","position","positions","place","places","whereabouts","room","rooms"]),reads:"is in",matchesLocativePredicates:!0}),mood:Object.freeze({predicate:"mgx:feels",comment:"individual -> mood word: how the subject feels right now.",nouns:Object.freeze(["mood","moods","feeling","feelings","emotion","emotions"]),reads:"feels"}),mass:Object.freeze({predicate:"mgx:hasMass",comment:"individual -> number: the subject's current mass.",nouns:Object.freeze(["mass","masses","weight","weights"]),reads:"has mass"})}),qm=Object.freeze(Object.fromEntries(Object.entries(bo).flatMap(([e,{nouns:t}])=>t.map(n=>[n,e])))),Km=Object.freeze(Object.values(bo).map(e=>e.predicate)),uj=Object.freeze(["on","in","at","inside","under","below","above","near","beside","behind","by"]),dj=new RegExp(`^mgx:[a-z]+-(${uj.join("|")})$`,"i");Ym=Object.freeze([...Vm,"is the superclass of","are the superclass of","is the parent class of"]),fj=Object.freeze(new Set([...Ym,...Hm]));fn=Object.freeze(["defined","declared","located","implemented"]),cu=Object.freeze(["now","currently","right now","at the moment","these days","today"]),pj=new RegExp(`\\s+(?:${[...cu].sort((e,t)=>t.length-e.length).join("|")})(\\s*[?.!]*)$`,"i");Mn=Object.freeze(["mentioned","referenced"]),lu=Object.freeze(["in this graph","in the graph","in this codebase","in the codebase","in this repo","in the repo","here"]),mj=new RegExp(`\\s+(?:${lu.join("|")})\\s*[?.!]*$`,"i");hj=Object.freeze(["then","though","too"]),gj=new RegExp(`\\s+(?:${hj.join("|")})\\s*[?.!]*$`,"i"),bj=Object.freeze(["please explain","explain"]),wj=new RegExp(`,\\s*(?:${bj.join("|")})\\s*[?.!]*$`,"i");me=Object.freeze(Object.fromEntries(Object.entries(Jr).flatMap(([e,{verbs:t}])=>t.map(n=>[n,e])))),Qr=Object.freeze(new Set(["has","have","holds","hold"])),$a=Object.freeze(new Set(["search","describe","signature","impact","members","subclasses","exports","callers","callees","calls","tests","untested","history","cochanges","architecture","arch","related","sprite"])),yj=e=>!Ym.includes(e),Xm=Object.freeze([...new Set(Object.keys(me).filter(yj).map(e=>e.match(/^(?:is|are)\s+an?\s+(.+)$/i)).filter(Boolean).map(e=>e[1].toLowerCase()))]),Ze=Object.freeze({function:"Function",functions:"Function",method:"Method",methods:"Method",class:"Class",classes:"Class",module:"Module",modules:"Module",mod:"Module",mods:"Module",file:"Module",files:"Module",package:"Package",packages:"Package",attribute:"Attribute",attributes:"Attribute",field:"Attribute",fields:"Attribute",variable:"GlobalVariable",variables:"GlobalVariable",global:"GlobalVariable",globals:"GlobalVariable",change:"Change",changes:"Change",commit:"Commit",commits:"Commit"}),mn=Object.freeze({explicitly:"direct",directly:"direct",transitively:"transitive",indirectly:"transitive"}),Vs=Object.freeze({imported:"imports",called:"calls",used:"uses",tested:"tests",covered:"tests",verified:"tests",exercised:"tests",checked:"tests",defined:"defines",declared:"defines",inherited:"inherits",extended:"inherits",subclassed:"inherits",contained:"contains",exported:"reexports","re-exported":"reexports",exposed:"reexports",touched:"touches",changed:"touches",modified:"touches",edited:"touches",updated:"touches"}),va=Object.freeze({"inherited from":{kind:"inherits",role:"object"},"extended from":{kind:"inherits",role:"object"},"subclassed from":{kind:"inherits",role:"object"},"defined in":{kind:"defines",role:"agent"},"declared in":{kind:"defines",role:"agent"},"contained in":{kind:"contains",role:"agent"},"imported by":{kind:"imports",role:"agent"},"called by":{kind:"calls",role:"agent"},"used by":{kind:"uses",role:"agent"},"tested by":{kind:"tests",role:"agent"},"covered by":{kind:"tests",role:"agent"},"touched by":{kind:"touches",role:"agent"},"changed by":{kind:"touches",role:"agent"},"exported by":{kind:"reexports",role:"agent"}}),uu=Object.freeze({"ain't":"is not",aint:"is not","isn't":"is not",isnt:"is not","aren't":"are not",arent:"are not","doesn't":"does not",doesnt:"does not","don't":"do not",dont:"do not","didn't":"did not",didnt:"did not","there's":"there is",theres:"there is","what's":"what is",whats:"what is","who's":"who is",whos:"who is",gonna:"going to",wanna:"want to",gotta:"got to",yer:"your",ur:"your",gimme:"give me"}),du=Object.freeze({funtion:"function",funtions:"functions",fucntion:"function",fucntions:"functions",functoin:"function",functoins:"functions",calss:"class",calsses:"classes",classs:"class",clases:"classes",modul:"module",moduls:"modules",moduel:"module",moduels:"modules",moudle:"module",moudles:"modules",methdo:"method",methdos:"methods",mehtod:"method",mehtods:"methods",comit:"commit",comits:"commits",commmit:"commit",commmits:"commits",varaible:"variable",varaibles:"variables",varibale:"variable",varibales:"variables",atribute:"attribute",atributes:"attributes",improt:"import",improts:"imports",imoprt:"import",imoprts:"imports",inherts:"inherits",inheirts:"inherits",extands:"extends",extneds:"extends",depnds:"depends",touchs:"touches",tuoches:"touches",touhced:"touched",touchd:"touched",defned:"defined",chagned:"changed",chnaged:"changed",chagnes:"changes",chnages:"changes",calles:"calls",exprot:"export",exprots:"exports",tets:"tests",whcih:"which",wich:"which",whihc:"which",wehre:"where",whre:"where",waht:"what",wat:"what",dat:"that",dose:"does",doess:"does",teh:"the",manyn:"many",mnay:"many",amny:"many",mnany:"many",hwo:"how",coutn:"count",conut:"count",cuont:"count",ocunt:"count",numer:"number",nubmer:"number",numbr:"number",nmuber:"number",lst:"list",lsit:"list",ilst:"list",shwo:"show",hsow:"show",dispaly:"display",dsiplay:"display",funtcions:"functions",funciton:"function",funcitons:"functions"}),fu=Object.freeze({folder:"module",folders:"modules",directory:"module",directories:"modules",func:"function",funcs:"functions",changeset:"commit",changesets:"commits",revision:"commit",revisions:"commits",property:"attribute",properties:"attributes"}),Jm=/\b([a-z]{3,})in'/gi,Zr=Object.freeze(["um","uh","erm","so","like","yo","hey","bru","bro","fam","mate","please","could you","can you","would you","tell me","i wonder","just wondering","quickly","real quick","kinda","sorta","btw","by the way","you","quick q"]),wo=Object.freeze(["this","it","that","here","this one","that one"]),Qm=Object.freeze([{re:/\bthere\s+is\s+not\s+(?:anything|nothing)\s+(?:that\s+)?(\S.*)$/i,to:e=>`what ${e[1]}`},{re:/\bthere\s+is\s+no\s+\S+\s+(?:that\s+)?(\S.*)$/i,to:e=>`what ${e[1]}`},{re:/\bis\s+not\s+there\s+(?:anything|nothing)\s+(?:that\s+)?(\S.*)$/i,to:e=>`what ${e[1]}`},{re:/\b(?:nobody|nothing|no one)\s+(\S.*?)(?:,?\s+does\s+it\??|,?\s+do\s+they\??)?$/i,to:e=>`what ${e[1]}`}]),Zm=Object.freeze([{re:/^what\s+(?:is|was|were|are)\s+in\s+((?:commit\s+)?[0-9a-f]{7,40})\??$/i,to:e=>`what did ${e[1]} touch`},{re:/^what\s+(?:went|got)\s+into\s+((?:commit\s+)?[0-9a-f]{7,40})\??$/i,to:e=>`what did ${e[1]} touch`},{re:/^what\s+made\s+it\s+into\s+((?:commit\s+)?[0-9a-f]{7,40})\??$/i,to:e=>`what did ${e[1]} touch`}]),yo=Object.freeze(["mean","means","stand for","stands for","signify","signifies","represent","represents","refer to","refers to"]),En=Object.freeze(["that","which","who"]),bs=Object.freeze(["something","anything","everything","somethings","things","thing","entities","entity","nodes","node","stuff","code","symbol","symbols"]),sr=Object.freeze({"but do not":"difference","but does not":"difference","and do not":"difference","and does not":"difference","but not":"difference","and not":"difference",except:"difference",without:"difference",and:"intersection",plus:"intersection",but:"intersection",or:"union"}),ct=Object.freeze({public:{via:"visibility",value:"public"},private:{via:"visibility",value:"private"},protected:{via:"visibility",value:"protected"},static:{via:"attr",attr:"isStatic"},abstract:{via:"attr",attr:"isAbstract"},constant:{via:"attr",attr:"isConstant"},exported:{via:"exported"},"re-exported":{via:"exported"},tested:{via:"tested",value:!0},covered:{via:"tested",value:!0},untested:{via:"tested",value:!1},uncovered:{via:"tested",value:!1}}),eh=Object.freeze(new Set(["tests","test","anything","something","anyone","someone","any"])),$o=Object.freeze(["how many","how much","how many of","number of","total number of","quantity of","tally of","sum of","total of","amount of","count","count up","count of","tot up"]),vo=Object.freeze(["list","show","show me","show us","display","print","print out","dump","enumerate","name","give me","get me","spit out","rattle off","run down","run through","ls","what are","which are"]),Hn=Object.freeze({most:"most",greatest:"most",highest:"most",biggest:"most",largest:"most","most-connected":"most","most connected":"most",fewest:"fewest",least:"fewest",smallest:"fewest",lowest:"fewest"}),qn=Object.freeze({imports:{kind:"imports",dir:"out"},dependencies:{kind:"imports",dir:"out"},importers:{kind:"imports",dir:"in"},dependents:{kind:"imports",dir:"in"},callers:{kind:"calls",dir:"in",sibling:"callsSymbol"},callees:{kind:"calls",dir:"out",sibling:"callsSymbol"},calls:{kind:"calls",dir:"out",sibling:"callsSymbol"},methods:{kind:"contains",dir:"out",filter:"Method"},members:{kind:"contains",dir:"out"},tests:{kind:"tests",dir:"in"},test:{kind:"tests",dir:"in"},subclasses:{kind:"inherits",dir:"in"},connections:{kind:"*",dir:"both"},edges:{kind:"*",dir:"both"},connected:{kind:"*",dir:"both"},imported:{kind:"imports",dir:"in"},"depended-on":{kind:"imports",dir:"in"},depended:{kind:"imports",dir:"in"},used:{kind:"imports",dir:"in",sibling:"callsSymbol"},called:{kind:"calls",dir:"in",sibling:"callsSymbol"}}),th=Object.freeze({tests:"Module",test:"Module"}),ei=Object.freeze(["those","them","these"]),or=Object.freeze(["contains","defines"]),xa=Object.freeze(["the","a","an","some","other","about","please","pls","plz","kindly","just","simply","maybe","perhaps","thanks","thank","ta","cheers","too","also","well","either","sorry","oops","actually","mean","meant","rather","hi","hello","hey","yo","hiya","howdy","ok","okay","matey","mate","buddy","pal","dude","man","bro","bru","fam","friend","sir","maam","folks","guys","everyone","dear","tmct","show","tell","give","list","find","me","us","lemme"]),rr=Object.freeze({tally:"count",tallies:"count",sum:"count",total:"count",totals:"count"}),nh=Object.freeze(["help","help me","how do i ask","how do i use this","what can i ask","what can you ask","usage","commands","examples","syntax","options"])});var et,Hs,Ea=M(()=>{et="#000000",Hs=Object.freeze({happy:`<circle cx="-0.4" cy="-0.15" r="0.11" fill="${et}" opacity="0.85"/><circle cx="0.4" cy="-0.15" r="0.11" fill="${et}" opacity="0.85"/><path d="M -0.4 0.35 Q 0 0.68 0.4 0.35" fill="none" stroke="${et}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,sad:`<circle cx="-0.4" cy="-0.1" r="0.1" fill="${et}" opacity="0.85"/><circle cx="0.4" cy="-0.1" r="0.1" fill="${et}" opacity="0.85"/><path d="M -0.38 0.55 Q 0 0.3 0.38 0.55" fill="none" stroke="${et}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,angry:`<path d="M -0.58 -0.32 L -0.22 -0.16" stroke="${et}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><path d="M 0.58 -0.32 L 0.22 -0.16" stroke="${et}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><circle cx="-0.32" cy="-0.02" r="0.09" fill="${et}" opacity="0.85"/><circle cx="0.32" cy="-0.02" r="0.09" fill="${et}" opacity="0.85"/><path d="M -0.36 0.5 L 0.36 0.42" stroke="${et}" stroke-width="0.1" stroke-linecap="round" opacity="0.85"/>`,scared:`<circle cx="-0.4" cy="-0.12" r="0.2" fill="none" stroke="${et}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.4" cy="-0.12" r="0.07" fill="${et}" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.2" fill="none" stroke="${et}" stroke-width="0.07" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.07" fill="${et}" opacity="0.85"/><circle cx="0" cy="0.42" r="0.09" fill="none" stroke="${et}" stroke-width="0.07" opacity="0.85"/>`,surprised:`<circle cx="-0.38" cy="-0.12" r="0.17" fill="none" stroke="${et}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.38" cy="-0.12" r="0.06" fill="${et}" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.17" fill="none" stroke="${et}" stroke-width="0.07" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.06" fill="${et}" opacity="0.85"/><ellipse cx="0" cy="0.42" rx="0.16" ry="0.22" fill="${et}" opacity="0.7"/>`,calm:`<path d="M -0.5 -0.1 Q -0.4 -0.2 -0.3 -0.1" fill="none" stroke="${et}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/><path d="M 0.3 -0.1 Q 0.4 -0.2 0.5 -0.1" fill="none" stroke="${et}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/><path d="M -0.3 0.4 Q 0 0.5 0.3 0.4" fill="none" stroke="${et}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/>`})});var $j,Sn,sh,oh,pu,rh,yD,$D,ih=M(()=>{Kn();Ea();$j=()=>Object.keys(Hs).sort(),Sn=e=>({type:"object",required:["symbol"],properties:{symbol:{type:"string",description:e}}}),sh=e=>({type:"object",required:["module"],properties:{module:{type:"string",description:e}}}),oh=e=>({type:"object",required:["class"],properties:{class:{type:"string",description:e}}}),pu=Object.freeze([{name:"tmct_context",tier:"hot",summary:"A sized edit bundle for one symbol \u2014 exemplar source, sibling signatures, registration anchor and the insertion region, in one call.",agentDescription:"START HERE to add/modify code: ONE call returns a sized edit bundle (exemplar source, sibling signatures, registration, insertion region) \u2014 then write directly, don't Read.",inputSchema:{type:"object",required:["symbol"],properties:{symbol:{type:"string",description:"Module path (e.g. path/to/module) or a sibling function/class name defined in it."},depth:{type:"string",enum:["min","auto","full"],default:"auto",description:"auto (sized to the task) | min (leanest) | full (every section)."}}},example:{symbol:"django/utils/text.py"}},{name:"tmct_snippet",tier:"hot",summary:"The exact source of one function, class or Class.method \u2014 its line span only, plus a one-line in-repo call hint.",agentDescription:"EXACT source of one function/class/Class.method by name (its line span only) + a one-line in-repo call hint. Prefer over Read for a single symbol.",inputSchema:{type:"object",required:["symbol"],properties:{symbol:{type:"string",description:"function/class name, Class.method, or fn:<path>#name."}}},example:{symbol:"Truncator.chars"}},{name:"tmct_ask",tier:"hot",summary:"A structural question in plain English, answered from the graph in one call \u2014 no model, and a clean miss instead of a guess.",agentDescription:'Ask a structural question in plain English: "which functions call X", "what uses X", "where is X defined", "when did X change". One call, no model. A clean miss beats a guess.',inputSchema:{type:"object",required:["query"],properties:{query:{type:"string",description:'A free-text question, e.g. "which functions explicitly couple to logging".'}}},example:{query:"which modules import src/core/model.mjs"},chat:{exampleRepo:"examples/mini-webapp",grammar:[{form:"which <things> <relation-verb> <entity>",example:"which modules import src/core/model.mjs",answers:"the imports edge, read forwards"},{form:"what is <relation-verb-passive> <entity>",example:"what is imported by src/core/store.mjs",answers:"the same edge, read backwards \u2014 a passive is the opposite direction, not a synonym"},{form:"what <relation-verb> <entity>",example:"what uses src/lib/http.mjs",answers:"the uses union: imports plus calls"},{form:"where is <entity> <where-marker>",example:"where is saveStore defined",answers:"the definition's file and line span"},{form:"when did <entity> change",example:"when did src/core/store.mjs change",answers:"the commits that touched it, newest first"}],whereMarkers:fn}},{name:"tmct_describe",tier:"cold",summary:"Locate one symbol and list its typed edges (both directions) with provenance.",inputSchema:Sn("A module path, symbol name, or Class.method."),example:{symbol:"django/utils/text.py"}},{name:"tmct_signature",tier:"cold",summary:"One symbol's API surface (params, returns, raises/catches, flags, decorators, doc) without the body.",inputSchema:Sn("A function, method, or Class.method name."),example:{symbol:"Truncator.chars"}},{name:"tmct_impact",tier:"cold",summary:"Transitive reverse closure over imports/calls \u2014 what breaks if a module or symbol changes, by depth, with tests.",inputSchema:sh("The module (or a symbol it defines) whose dependents you want."),example:{module:"django/utils/text.py"}},{name:"tmct_search",tier:"cold",summary:"Free-text/ranked lookup over the code-map to find the right module or symbol.",inputSchema:{type:"object",required:[],properties:{query:{type:"string",description:"Free text to rank against the code-map. Required unless kind narrows the search on its own."},kind:{type:"string",description:"Restrict to an entity class, e.g. function, class, module."},decorator:{type:"string",description:"Restrict to definitions carrying this decorator."},name:{type:"string",description:"Restrict to definitions whose name matches."}}},example:{query:"template filters",kind:"function"}},{name:"tmct_members",tier:"cold",summary:"A class's methods + attributes (file:line, decorators) in one slice.",inputSchema:oh("The class whose members you want."),example:{class:"Truncator"}},{name:"tmct_subclasses",tier:"cold",summary:"A class's base classes plus the transitive set of classes that extend it.",inputSchema:oh("The class to walk the inheritance edges of."),example:{class:"Field"}},{name:"tmct_related",tier:"cold",summary:"A term's synonyms (skos:altLabel) and related concepts (skos:related), from the memory graph's relation facts.",inputSchema:{type:"object",required:["term"],properties:{term:{type:"string",description:"The term whose synonyms / related concepts you want."}}},example:{term:"sofa"}},{name:"tmct_sprite",tier:"cold",summary:"The sprite markup for a class, resolved up the taught rdfs:subClassOf chain \u2014 with the expression and size asked for, and the ancestor chain the resolver walked to find it.",inputSchema:{type:"object",required:["class"],properties:{class:{type:"string",description:"The class to draw, e.g. spider. Resolved through the memory graph's own rdfs:subClassOf taxonomy."},expression:{type:"string",enum:$j(),description:"The face the sprite wears, as an mgx:feels value. A class whose template takes no expression parameter misses rather than dropping it."},size:{type:"string",description:"A taught size property word (mgx:hasProperty), resolved to a numeric render SCALE \u2014 the size of the thing drawn, not a choice of template tier."}}},example:{class:"spider",expression:"happy",size:"large"}},{name:"tmct_architecture",tier:"cold",summary:"Package/module map + the most-imported hub modules (optionally scoped to a package).",inputSchema:{type:"object",required:[],properties:{package:{type:"string",description:"Scope the map to one package. Omit for the whole repository."}}},example:{package:"django/template"}},{name:"tmct_exports",tier:"cold",summary:"A module's public __all__ surface, each name resolved to the module that defines it.",inputSchema:sh("The module whose public API surface you want."),example:{module:"django/db/models/__init__.py"}},{name:"tmct_tests_for",tier:"cold",summary:"The test modules covering a symbol or module, from the typed test edges.",inputSchema:Sn("The symbol or module to find covering tests for."),example:{symbol:"django/utils/text.py"}},{name:"tmct_untested",tier:"cold",summary:"Source modules with no covering test module \u2014 a coverage-gap view (no arguments).",inputSchema:{type:"object",required:[],properties:{}},example:{}},{name:"tmct_history",tier:"cold",summary:"Recent commits that touched a symbol's module (newest first).",inputSchema:Sn("The symbol whose module's history you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_file_history",tier:"cold",summary:"Commits that touched a symbol's module, each with author / date / subject.",inputSchema:Sn("The symbol whose module's history you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_method_history",tier:"cold",summary:"Commits that touched a specific method symbol (fine-grained), with author / date / subject.",inputSchema:Sn("A Class.method name."),example:{symbol:"Truncator.chars"}},{name:"tmct_class_history",tier:"cold",summary:"Commits that touched a specific class symbol (fine-grained), with author / date / subject.",inputSchema:Sn("A class name."),example:{symbol:"Truncator"}},{name:"tmct_callers",tier:"cold",summary:"Modules that call into a symbol's module (one hop).",inputSchema:Sn("The symbol whose callers you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_callees",tier:"cold",summary:"Modules a symbol's module calls into (one hop).",inputSchema:Sn("The symbol whose callees you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_calls",tier:"cold",summary:"The in-repo symbols a function calls (fn\u2192fn), each with file:line.",inputSchema:Sn("The function whose in-repo call sites you want."),example:{symbol:"slugify"}},{name:"tmct_cochanges",tier:"cold",summary:"Modules that historically change in the same commit as a symbol's module (git co-change).",inputSchema:Sn("The symbol whose module's change-coupling you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_context_more",tier:"cold",summary:"The bundle sections a lean tmct_context omitted (siblings / tests / cochange / class members / re-exports).",inputSchema:Sn("The symbol a lean tmct_context bundle was built for."),example:{symbol:"django/utils/text.py"}},{name:"tmct_export",tier:"cold",summary:"Every stored memory fact as JSONL (subject/predicate/object/provenance) \u2014 the shape `tmct extract` emits, for backup or audit.",inputSchema:{type:"object",required:[],properties:{}},example:{}},{name:"tmct_ingest",tier:"cold",summary:"Ground plain text into memory facts with the same deterministic recognizer the chat teach lane uses \u2014 the strict tier, plus an optional lower-trust fuzzy tier \u2014 and report the canonical triples.",inputSchema:{type:"object",required:["text"],properties:{text:{type:"string",description:"The plain text to ground into facts."},optimistic:{type:"boolean",description:"Also run the lower-trust fuzzy tier over sentences the strict recognizer skips."}}},example:{text:"A kettle is a container. An otter is a mammal.",optimistic:!0}}]),rh=pu.filter(e=>e.tier==="hot"),yD=pu.filter(e=>e.tier==="cold"),$D=Object.freeze(pu.map(e=>e.name))});var ah,Ne,Kt=M(()=>{Je();ah=ne(".tmct","graph.json"),Ne=class extends Error{constructor(t){super(t),this.name="ToolError"}}});function vj(e){let t=new Set;for(let n of Array.isArray(e?.individuals)?e.individuals:[])n&&n.id&&t.add(n.id);return t}function ch(e){let t=(Array.isArray(e)?e:[]).map((c,l)=>({file:c?.file,payload:c?.payload||{},name:c?.name!=null&&String(c.name).length?String(c.name):String(l)})),n=t.map(({payload:c})=>vj(c)),s=new Map;for(let c of n)for(let l of c)s.set(l,(s.get(l)||0)+1);let o=new Set([...s.entries()].filter(([,c])=>c>1).map(([c])=>c)),r={generated_at:"",classes:[],vocabulary:[],objectProperties:[],individuals:[],proseIndex:{}},i="",a=t.length>0;for(let{payload:c,name:l}of t){a=a&&!!c.bootstrap,typeof c.generated_at=="string"&&c.generated_at>i&&(i=c.generated_at);let u=p=>o.has(p)?`${l}/${p}`:p;Array.isArray(c.classes)&&r.classes.push(...c.classes),Array.isArray(c.vocabulary)&&r.vocabulary.push(...c.vocabulary);for(let p of Array.isArray(c.individuals)?c.individuals:[]){if(!p)continue;let f={...p};f.id&&(f.id=u(f.id)),Array.isArray(f.derived_from)&&(f.derived_from=f.derived_from.map(m=>u(m))),Array.isArray(f.mentions)&&(f.mentions=f.mentions.map(m=>m&&m.id?{...m,id:u(m.id)}:m)),r.individuals.push(f)}for(let p of Array.isArray(c.objectProperties)?c.objectProperties:[]){if(!p)continue;let f={...p};Array.isArray(f.examples)&&(f.examples=f.examples.map(m=>{if(!m)return m;let h={...m};return h.subject&&(h.subject=u(h.subject)),h.object&&(h.object=u(h.object)),h})),r.objectProperties.push(f)}let d=c.proseIndex&&typeof c.proseIndex=="object"?c.proseIndex:{};for(let[p,f]of Object.entries(d)){let m=r.proseIndex[p]||(r.proseIndex[p]=[]);for(let h of Array.isArray(f)?f:[]){let g=u(h);m.includes(g)||m.push(g)}}}return r.generated_at=i,a&&(r.bootstrap=!0),r}var lh=M(()=>{});var ar={};Lt(ar,{clearCache:()=>xj,emptyEntities:()=>mu,fetchEntities:()=>kj,registerProvider:()=>Ej});function xj(){ir=null,ti=null}function Ej(e){if(e!=null&&typeof e!="function")throw new TypeError("registerProvider expects a function (config) => entities payload, or null");let t=Sa;return Sa=e??null,ir=null,t}function mu(){return{generated_at:"",bootstrap:!0,classes:[],vocabulary:[],objectProperties:[],individuals:[],proseIndex:{}}}async function Sj(e){let t;try{t=await Ie(e,"utf8")}catch(n){if(n?.code==="ENOENT")return mu();throw new Ne(`cannot read graph artifact at ${e} (${n?.code||n?.message||n})`)}try{return JSON.parse(t)}catch{throw new Ne(`graph artifact ${e} is not valid JSON`)}}async function jj(e){let t=e.graphFiles,n=[...t].map(String).sort().join("|");if(ti&&ti.key===n)return ti.payload;let s=[];for(let r=0;r<t.length;r++){let i=await Sj(t[r]);s.push({file:t[r],payload:i,name:e.graphNames?.[r]})}let o=ch(s);return ti={key:n,payload:o},o}async function kj(e){if(Sa){let s;try{s=await Sa(e)}catch(o){throw o instanceof Ne?o:new Ne(`graph provider failed (${o?.message||o})`)}if(!s||typeof s!="object")throw new Ne("graph provider returned no entities payload");return s}if(Array.isArray(e.graphFiles)&&e.graphFiles.length>1)return jj(e);if(ir&&ir.file===e.graphFile)return ir.payload;let t;try{t=await Ie(e.graphFile,"utf8")}catch(s){if(s?.code==="ENOENT")return mu();throw new Ne(`cannot read graph artifact at ${e.graphFile} (${s?.code||s?.message||s})`)}let n;try{n=JSON.parse(t)}catch{throw new Ne(`graph artifact ${e.graphFile} is not valid JSON`)}return ir={file:e.graphFile,payload:n},n}var ir,ti,Sa,ni=M(()=>{Pt();Kt();lh();ir=null,ti=null,Sa=null});function Yn(e){if(!e)return[];let t=String(e).replace(/\.[A-Za-z0-9]+$/,"");return t=t.replace(/[/\\]/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/([A-Za-z])([0-9])/g,"$1 $2").replace(/([0-9])([A-Za-z])/g,"$1 $2").replace(/[_\-.]+/g," "),t.split(/\s+/).map(n=>n.toLowerCase()).filter(n=>n.length>1&&n.length<=uh)}function hu(e){if(!e)return[];let t=[],n=new Set;for(let s of String(e).toLowerCase().split(/[^a-z0-9]+/))if(!(s.length<2||s.length>uh||Rj.has(s))&&!n.has(s)&&(n.add(s),t.push(s),t.length>=_j))break;return t}function ja({name:e,doc:t}={}){return[...new Set([...Yn(e),...hu(t)])].sort()}function dh(e){let t=Object.create(null);for(let n of e){let s=(n.attributes||[]).find(o=>o.key==="prose_tokens");if(s?.value)for(let o of s.value.split(" "))t[o]||(t[o]=[]),t[o].push(n.id)}for(let n of Object.keys(t))t[n].sort();return t}function xo(e,t,{limit:n=10}={}){let s=[...new Set([...Yn(t),...hu(t)])];if(!s.length)return[];let o=new Map;for(let r of s)for(let i of e?.[r]||[])o.set(i,(o.get(i)||0)+1);return[...o.entries()].sort((r,i)=>i[1]-r[1]||String(r[0]).localeCompare(i[0])).slice(0,n).map(([r,i])=>({id:r,score:i}))}function fh(e,t){let n=e&&(e["tmct:layers"]?e:e.proseIndex),s=n&&n["tmct:layers"],o=String(t||"").toLowerCase(),r={ids:[],via:null};if(!o||!s||typeof s!="object")return r;let i=new Set,a=new Set;for(let c of Object.keys(s)){let l=s[c];if(!l||typeof l!="object")continue;let u=l[o],d=Array.isArray(u)?u:Array.isArray(u?.ids)?u.ids:null;if(d?.length){for(let p of d)i.add(p);a.add(c)}}return i.size?{ids:[...i].sort(),via:[...a].sort().join("+")}:r}var Rj,uh,_j,qs=M(()=>{Rj=new Set("a an and or but the of to in on at for with from by as is are was were be been being it its this that these those i you he she they we me my your our do does did not no yes if then else than so such can will would should could may might about into over under out up down off again more most some any all what which who whom whose when where why how".split(/\s+/)),uh=40,_j=120});function ph(e){let t=e.indexOf("@"),n=t>=0?e.slice(0,t):e,s=t>=0?e.slice(t+1):"",o=n.indexOf(":"),r=o>=0?n.slice(o+1):"";return{createdAt:s,...r?{sessionId:r}:{}}}function Tj(e){if(!e.startsWith(hh))return null;let t=e.indexOf("@"),n=t>=0?e.slice(0,t):e,s=t>=0?e.slice(t+1):"",o=n.indexOf(mh);if(o<0)return null;let r=n.slice(o+mh.length);return r?{kind:"teachNode",nodeId:r,displayName:n.slice(hh.length,o),createdAt:s}:null}function Fn(e){let t=String(e||"").trim();if(!t)return null;if(t.startsWith("reference:")){let s=t.slice(10),o=s.indexOf(":");if(o<0)return{kind:"reference",pack:s||"unknown",article:""};let r=s.slice(0,o)||"unknown";return{kind:Cj(r),pack:r,article:s.slice(o+1)}}if(t.startsWith("research:")){let s=t.slice(9),o=s.lastIndexOf("@");return{kind:"referenceLive",pack:"research",article:(o>=0?s.slice(0,o):s).trim()||"unknown"}}let n=t.split(/\s+/)[0];if(n.startsWith("corpus-weak:"))return{kind:"corpusWeak",name:n.slice(12)||"unknown"};if(n.startsWith("corpus:"))return{kind:"corpus",name:n.slice(7)||"unknown"};if(n.startsWith("child:"))return{kind:"corpus",name:n.slice(6).split(":")[0]||"unknown"};if(n.startsWith("world:"))return{kind:"corpus",name:n.slice(6).split(":")[0]||"unknown"};if(n.startsWith("mud:"))return{kind:"corpus",name:`mud:${n.slice(4).split(":")[0]||"unknown"}`};if(n.startsWith("ace:"))return{kind:"operator",...ph(n.slice(4))};if(n.startsWith("teach:")){let s=n.slice(6),o=Tj(s);return o||{kind:"teach",...ph(s)}}return n.startsWith("web:")?{kind:"web",url:n.slice(4)}:n.startsWith("url:")?{kind:"web",url:n.slice(4)}:n.startsWith("news-fixture:")?{kind:"corpus",name:n.slice(13).split("@")[0]||"unknown"}:n.startsWith("extracted:news:")?{kind:"web",url:n.slice(10)}:n.startsWith("news:")?{kind:"web",url:n}:n.startsWith("optimistic-extract:")?{kind:"optimisticExtract",name:n.slice(19)||"unknown"}:n.startsWith("extracted:")?{kind:"extracted",name:n.slice(10)||"unknown"}:n.startsWith("entailed:")?{kind:"entailed",rule:n.slice(9)}:n.startsWith("chat:")||n.startsWith("session:")||n.startsWith("operator")?{kind:"operator"}:null}function $h(e){let t=(e?.attributes||[]).find(s=>s.prop==="mgx:sourceReliability")?.value;if(t===void 0)return bh;let n=Number(t);return Number.isFinite(n)?Math.max(gu,Math.min(yh,n)):bh}function vh(e,t=Date.now(),n=Ij){let s=Date.parse(e);if(!Number.isFinite(s))return 1;let o=Math.max(0,t-s);return gh+(1-gh)*Math.pow(.5,o/n)}function xh(e,t={},n={}){let s=typeof n.now=="number"?n.now:Date.now(),o=Array.isArray(e?.sourceIds)?e.sourceIds:[],r=new Set,i=[],a=[];for(let f of o){if(r.has(f))continue;r.add(f);let m=t[f],h=Oj(m);if(!h)continue;i.push(h);let g=(ws[h]??0)*$h(m);a.push(Math.max(0,Math.min(1,g)))}let c=0,l=1;for(let f of a)l*=1-f;if(a.length&&(c=Math.min(1,1-l)),i.includes("entailed")&&Array.isArray(n.premiseTrusts)&&n.premiseTrusts.length){let f=typeof n.ruleConfidence=="number"?n.ruleConfidence:1;c=Math.max(0,Math.min(1,Math.min(...n.premiseTrusts)*f))}let u=vh(e?.createdAt,s,n.halfLifeMs),d=cr(Math.min(1,c*u)),p={sourceTypes:i.slice().sort(),corroboration:i.length,createdAt:e?.createdAt||"",recency:cr(u)};return{score:d,inputs:p}}function Ra(e,t){let n=(ws[e]??0)*$h(t);return cr(Math.max(0,Math.min(1,n)))}function Nj(e){if(e==="operator")return 1;let t=ws[e];return t===void 0?1:(t+1)/2}function _a(e,t={}){let n=typeof t.now=="number"?t.now:Date.now(),s=Array.isArray(e)?e:[],o=new Map,r=[];for(let a of s){let c=vh(a?.assertedAt,n,t.halfLifeMs),l=Math.max(0,Math.min(1,Number(a?.ownTrust)||0)),u=a?.sourceType||"",d=Math.max(0,Math.min(1,l*c)),p=o.get(u)||{complement:1,strongest:0};p.complement*=1-d,p.strongest=Math.max(p.strongest,d),o.set(u,p),r.push({sourceId:a?.sourceId||"",sourceType:u,ownTrust:l,recency:cr(c)})}let i=1;for(let[a,c]of o){let l=Math.max(Nj(a),c.strongest);i*=1-Math.min(1-c.complement,l)}return{score:s.length?cr(Math.min(1,1-i)):0,inputs:r}}function Eh(e){return _a(e,{halfLifeMs:Lj})}function Sh({factsAsserted:e=0,factsContradicted:t=0}={}){let n=Math.max(0,Number(e)||0),s=Math.max(0,Number(t)||0),o=Math.max(-1,Math.min(1,(n-2*s)/Math.max(1,n))),r=n/(n+Pj),i=(o*r+1)/2;return cr(gu+(yh-gu)*i)}var lr,ka,lt,Ks,mh,hh,Aj,Cj,ws,bu,wh,Ij,gh,gu,yh,bh,cr,Oj,Lj,Pj,Dn=M(()=>{lr="mgx:trustScore",ka="mgx:trustInputs",lt="mgx:createdAt",Ks="mgx:updatedAt";mh="#node:",hh="peer:";Aj="wikipedia-live",Cj=e=>e===Aj?"referenceLive":"reference";ws=Object.freeze({operator:1,teach:.95,provider:.9,corpus:.7,reference:.6,corpusWeak:.55,referenceLive:.5,extracted:.45,web:.4,optimisticExtract:.35,entailed:.3}),bu=Object.freeze({operator:{subClass:"tmct:AgentSource",prov:"prov:Agent"},teach:{subClass:"tmct:AgentSource",prov:"prov:Agent"},provider:{subClass:"tmct:AgentSource",prov:"prov:Agent"},corpus:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},corpusWeak:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},reference:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},referenceLive:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},web:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},extracted:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},optimisticExtract:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},entailed:{subClass:"tmct:ActivitySource",prov:"prov:Activity"}}),wh=new Set(Object.entries(bu).filter(([,e])=>e.prov==="prov:Agent").map(([e])=>e)),Ij=720*60*60*1e3,gh=.9,gu=.5,yh=1.5,bh=1,cr=(e,t=6)=>Number(e.toFixed(t)),Oj=e=>(e?.attributes||[]).find(t=>t.prop==="mgx:sourceType")?.value||"";Lj=1/0;Pj=19});var Eo,wu=M(()=>{Eo=e=>/(^|\/)tests?\//.test(e)||/(^|\/)test_[^/]*\.py$/.test(e)||/\.tests(\.|$)/.test(e)||/(^|\/)[^/]*[-_]tests?\//.test(e)||/\.(test|spec)\.[cm]?[jt]sx?$/.test(e)});function yu(e,t){return Math.log(1+e/(1+t))}var si=M(()=>{});var Aa={};Lt(Aa,{bfsLevels:()=>Ta,findActionPath:()=>oi,findReachableSet:()=>$u});function jh(e){return e&&typeof e=="object"?JSON.stringify(e):String(e)}function kh(e,t){let n=[];for(let{action:s,nextState:o}of t(e)||[])n.push({state:o,actions:[s],states:[e,o]});return n}function oi(e,t,n,{maxDepth:s=50,stateKey:o=jh}={}){if(t(e))return{actions:[],states:[e]};let r=kh(e,n),i=new Set([o(e)]);for(let a=1;a<=s&&r.length;a+=1){for(let l of r)if(t(l.state))return{actions:l.actions,states:l.states};if(a===s)break;let c=[];for(let l of r){let u=o(l.state);if(!i.has(u)){i.add(u);for(let{action:d,nextState:p}of n(l.state)||[]){let f=o(p);i.has(f)||c.push({state:p,actions:[...l.actions,d],states:[...l.states,p]})}}}r=c}return null}function $u(e,t,{maxDepth:n=50,stateKey:s=jh}={}){let o=kh(e,t),r=new Set([s(e)]),i=[];for(let a=1;a<=n&&o.length;a+=1){let c=[];for(let l of o){let u=s(l.state);if(!r.has(u)&&(r.add(u),i.push({node:l.state,path:{actions:l.actions,states:l.states}}),a!==n))for(let{action:d,nextState:p}of t(l.state)||[]){let f=s(p);r.has(f)||c.push({state:p,actions:[...l.actions,d],states:[...l.states,p]})}}o=c}return i}function*Ta(e,t,{maxDepth:n=8,keyOf:s=o=>o}={}){let o=new Set([e]),r=[e];for(let i=1;i<=n&&r.length;i+=1){let a=[],c=[];for(let l of r)for(let u of t(l)||[]){let d=s(u);o.has(d)||(o.add(d),a.push(u),c.push(d))}r=c,yield a}}var ys=M(()=>{});function Ia(e){let t=Array.isArray(e?.individuals)?e.individuals:[],n=new Map;for(let r of t)r&&r.id&&n.set(r.id,r);let s=(Array.isArray(e?.objectProperties)?e.objectProperties:[]).filter(r=>r&&(r.predicate||r.prop)).map(r=>{let i=(Array.isArray(r.examples)?r.examples:[]).filter(a=>a&&a.subject&&a.object);return{predicate:String(r.predicate||""),prop:r.prop||null,count:Number(r.count)||i.length,edges:i}}),o=s.filter(r=>r.count>r.edges.length).map(r=>({predicate:r.predicate,count:r.count,shown:r.edges.length}));return{individuals:t,byId:n,relations:s,truncated:o,generatedAt:e?.generated_at||null,proseIndex:e?.proseIndex||{}}}function ri(e){return!e||!Array.isArray(e.individuals)?0:e.individuals.filter(t=>(t.class||"")==="Module").length}function xs(e){let t=String(e?.prop||"").toLowerCase();if(Rh[t])return Rh[t];let n=String(e?.predicate||"").toLowerCase();if(/symbol/.test(n)){if(/\b(call|invoke)/.test(n))return"callsSymbol";if(/(touch|chang|modif)/.test(n))return"touchesSymbol"}return/\bimport/.test(n)?"imports":/\b(call|invoke)/.test(n)?"calls":/\b(define|export|declare)/.test(n)?"defines":/\b(test|cover)/.test(n)?"tests":/\b(touch|chang|modif)/.test(n)?"touches":/\bcontain/.test(n)?"contains":/\b(inherit|subclass|extend|specializ)/.test(n)?"inherits":/denot/.test(n)?"denotes":/\bserve/.test(n)?"serves":null}function jn(e){return String(e||"").trim().toLowerCase().replace(/^\.\//,"").replace(/^\//,"")}function vu(e){let t=jn(e).split("/");return t[t.length-1]}function Mj(e){return(e?.derived_from||[]).filter(zh).length}function _h(e){return(e?.mentions||[]).reduce((n,s)=>n+(Number(s?.count)||0),0)+Mj(e)}function hn(e,t){let n=jn(t);if(!n)return{match:null,candidates:[]};let s=vu(n),o=!n.includes("/"),r=[];for(let i of e.individuals){let a=jn(i.label),c=String(i.id||"").toLowerCase(),l=0;a===n||c===n?l=100:a.endsWith(`/${n}`)||o&&(vu(a)===s||vu(a).replace(/\.[a-z]+$/,"")===s)?l=80:a.includes(n)&&(l=Math.max(10,50-(a.length-n.length))),l>0&&r.push({ind:i,score:l})}return r.sort((i,a)=>a.score-i.score||_h(a.ind)-_h(i.ind)||String(i.ind.label).length-String(a.ind.label).length),{match:r[0]?.ind||null,candidates:r.slice(1,5).map(i=>i.ind)}}function Vt(e){let t=(e?.attributes||[]).find(s=>s.key==="site");if(!t)return null;let n=String(t.value).match(/^(.*):(\d+)(?:-(\d+))?$/);return n?{path:n[1],start:Number(n[2]),end:n[3]?Number(n[3]):Number(n[2])}:null}function Fj(e,t){let n=[],s=[];for(let o of e.relations){let r=o.edges.filter(a=>a.subject===t),i=o.edges.filter(a=>a.object===t);r.length&&n.push({group:o,edges:r}),i.length&&s.push({group:o,edges:i})}return{out:n,incoming:s}}function Th(e){return e.prop?`${e.predicate} [${e.prop}]`:e.predicate}function vs(e){let t=e||"Entity",n=Yn(t);return n.length<2?t:n.map(s=>s[0].toUpperCase()+s.slice(1)).join(" ")}function vt(e,t,n=", "){return e.length<=t?e.join(n):e.slice(0,t).join(n)+`, +${e.length-t} more`}function Ru(e,t,{candidates:n=[]}={}){let s=[];s.push(`${t.label} \u2014 ${vs(t.class)} (id: ${t.id})`);let o=(t.derived_from||[]).filter(zh);o.length&&s.push(`attestation: ${o.length} provenance ref(s)`);for(let c of t.attributes||[])s.push(`attribute: ${c.key} = ${c.value}${c.prop?` [${c.prop}]`:""}`);let{out:r,incoming:i}=Fj(e,t.id);if(!r.length&&!i.length)s.push("edges: none in the current artifact");else{s.push("edges:");for(let{group:c,edges:l}of r)s.push(` ${Th(c)} (${l.length}) \u2192 ${vt(l.map(u=>u.objectLabel||u.object),Ah)}`);for(let{group:c,edges:l}of i)s.push(` \u2190 ${Th(c)} (${l.length}) by ${vt(l.map(u=>u.subjectLabel||u.subject),Ah)}`)}let a=t.derived_from||[];return a.length&&s.push(`provenance: ${vt(a,Dj)}`),n.length&&s.push(`other matches: ${n.map(c=>`${c.label} (${vs(c.class)})`).join(", ")}`),e.truncated.length&&s.push(zj(e)),s.join(`
2
+ `)}function zj(e){return`note: partial edge lists for: ${e.truncated.map(n=>`${n.predicate} (${n.shown}/${n.count})`).join(", ")}. Counts are complete; the lists are not.`}function dr(e,t,{maxDepth:n=8,includeCycleReturn:s=!1}={}){let o=new Map,r=new Map,i=(c,l,u,d)=>{!c||!l||c===l||(o.has(c)||o.set(c,[]),o.get(c).push({id:l,label:u,via:d}))};for(let c of e.relations){let l=xs(c);if(l==="imports"||l==="calls")for(let u of c.edges)i(u.object,u.subject,u.subjectLabel||u.subject,c.predicate);else if(l==="callsSymbol")for(let u of c.edges){let d=$s(e,u.subject),p=$s(e,u.object);if(!d||!p)continue;let f=e.byId.get(d)?.label||d;i(p,d,f,c.predicate),d!==p&&i(u.object,d,f,c.predicate)}else if(l==="tests")for(let u of c.edges)r.has(u.object)||r.set(u.object,[]),r.get(u.object).push(u.subjectLabel||u.subject);else if(l==="serves")for(let u of c.edges)i(u.subject,u.object,u.objectLabel||u.object,c.predicate)}let a=[];for(let c of Ta(t.id,l=>o.get(l)||[],{maxDepth:n,keyOf:l=>l.id})){if(!c.length)continue;let l=c.map(u=>({...u,tests:r.get(u.id)||[]})).sort((u,d)=>String(u.label).localeCompare(String(d.label)));a.push(l)}for(let c=0;s&&c<a.length;c+=1){let l=a[c].flatMap(d=>(o.get(d.id)||[]).filter(p=>p.id===t.id)).sort((d,p)=>String(d.via).localeCompare(String(p.via)));if(!l.length)continue;let u={...l[0],tests:r.get(t.id)||[]};a[c+1]||(a[c+1]=[]),a[c+1]=[...a[c+1],u].sort((d,p)=>String(d.label).localeCompare(String(p.label)));break}return a}function Uh(e,t,{maxDepth:n=8}={}){let s=dr(e,t,{maxDepth:n}),o=[`Impact of changing ${t.label} (reverse closure over imports/calls edges, module- and function-level):`];s.length||o.push("no dependents found in the current artifact \u2014 nothing imports or calls it (or its edges are not in the extracted graph yet).");let r=s.reduce((a,c)=>a+c.length,0);s.length&&o.push(`total: ${r} dependent(s) across ${s.length} depth level(s) (lists capped for brevity).`),s.forEach((a,c)=>{if(c>=Uj){o.push(`depth ${c+1}: ${a.length} more dependent(s) (not listed)`);return}o.push(c===0?`depth 1 (${a.length} direct dependents):`:`depth ${c+1} (${a.length}):`);for(let l of a.slice(0,xu)){let u=l.tests.length?`tests: ${vt(l.tests,Bj)}`:"tests: none recorded",d=c===0?`${l.via} it`:"reaches it through an intermediary";o.push(` - ${l.label} (${d}) \u2014 ${u}`)}a.length>xu&&o.push(` \u2026+${a.length-xu} more at depth ${c+1}`)});let i=e.truncated.filter(a=>{let c=xs({predicate:a.predicate});return c==="imports"||c==="calls"||c==="callsSymbol"||c==="tests"||c==="serves"});return i.length&&o.push("warning: partial edge lists ("+i.map(a=>`${a.predicate}: ${a.shown}/${a.count}`).join(", ")+") \u2014 this closure may be missing edges. Cross-check critical results with a lexical search (/find <term>)."),o.join(`
3
+ `)}function Bh(e){let t=new Map;for(let n of e.relations)if(xs(n)==="defines")for(let s of n.edges)t.has(s.subject)||t.set(s.subject,[]),t.get(s.subject).push(s.objectLabel||s.object);return t}function Ih(e){return new Set(String(e).replace(/([a-z0-9])([A-Z])/g,"$1_$2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean))}function qh(e,t,n=null){let s=n||(i=>$s(e,i)),o=new Map,r=(i,a)=>{!i||!a||i===a||(o.has(i)||o.set(i,new Set),o.has(a)||o.set(a,new Set),o.get(i).add(a),o.get(a).add(i))};for(let i of t)for(let a of _e(e,i))r(s(a.subject),s(a.object));return o}function Sk(e,t,n){if(t.length<2)return;let s=new Map(t.map(l=>[l.ind.id,l])),o=new Map(t.map(l=>[l.ind.id,l.score])),r=l=>{if(!l.size)return[[],[]];let u=0;for(let m of l.values())u=Math.max(u,m);let d=[...l.entries()].sort((m,h)=>h[1]-m[1]),p=[],f=[];for(let[m,h]of d)h>=u*mk&&p.length<n?p.push([m,h]):f.length<Ch&&f.push([m,h]);return[p,f]},[i,a]=r(new Map(t.map(l=>[l.ind.id,l.score]))),c=new Set(i.map(([l])=>l));for(let l=0;l<bk&&i.length;l++){let u=new Map,d=[];for(let p of wk){let f=qh(e,p),m=new Map;for(let[b,y]of i)for(let $ of f.get(b)||[])o.has($)&&m.set($,Math.max(m.get($)||0,y));let[h,g]=r(m);for(let[b,y]of h)u.set(b,Math.max(u.get(b)||0,y));d.push(...g)}a.push(...d);for(let[p,f]of u){if(c.has(p))continue;let m=s.get(p);m&&(m.score+=Math.min(f*hk,m.score*gk),c.add(p))}i=[...u.entries()],!i.length&&a.length&&(i=a.splice(0,Ch).filter(([p])=>!c.has(p)))}}function jk(e,t=[],{depth:n=Gh,q:s=Hh,nodeLimit:o=Vh,kinds:r=yk,classPredicate:i=u=>(u.class||"")==="Module",idNormalizer:a=null,seeds:c=null,hubDegree:l=1/0}={}){let u=new Map(t.map(x=>[x.ind.id,x])),d=0;for(let x of t)d=Math.max(d,x.score);let p=t.length>0&&d>0,f=new Set(c??u.keys());if(!f.size)return[];let m=qh(e,r,a),h=x=>m.get(x)?.size||0,g=[],b=(x,R)=>x.hop!==R.hop?x.hop<R.hop:x.deg!==R.deg?x.deg<R.deg:x.id<R.id,y=(x,R)=>{let w=g[x];g[x]=g[R],g[R]=w},$=x=>{g.push(x);let R=g.length-1;for(;R>0;){let w=R-1>>1;if(b(g[R],g[w]))y(R,w),R=w;else break}},E=()=>{let x=g[0],R=g.pop();if(g.length){g[0]=R;let w=0;for(;;){let T=2*w+1,I=2*w+2,j=w;if(T<g.length&&b(g[T],g[j])&&(j=T),I<g.length&&b(g[I],g[j])&&(j=I),j===w)break;y(w,j),w=j}}return x},_=new Set(f);for(let x of f)$({id:x,hop:0,deg:h(x)});let v=null,S=0,C=[];for(;g.length&&S<o;){let x=E();if(C.push({id:x.id,hop:x.hop}),!f.has(x.id)){if(p){let T=d*$k*Math.pow(vk,x.hop-1),I=u.get(x.id);if(I)I.score+=Math.min(T*xk,I.score*Ek);else{let j=e.byId?.get?.(x.id);if(j&&i(j)){v||(v=Bh(e));let k=v.get(j.id)||[],P={ind:j,score:T,defineCount:k.length,matching:[],density:0};t.push(P),u.set(x.id,P)}}}S++}if(x.hop>=n||x.hop>0&&h(x.id)>l)continue;let R=[];for(let T of m.get(x.id)||[]){if(_.has(T))continue;let I=e.byId?.get?.(T);!I||!i(I)||R.push({id:T,deg:h(T)})}if(!R.length)continue;R.sort((T,I)=>T.deg-I.deg||(T.id<I.id?-1:T.id>I.id?1:0));let w=Math.max(1,Math.floor(s*R.length));for(let T=0;T<w;T++){let I=R[T];_.add(I.id),$({id:I.id,hop:x.hop+1,deg:I.deg})}}return C}function Kh(e,t,n={}){let{demoteNonProd:s=!1,callAdjacency:o=!1,implOfInterface:r=!1,beamSearch:i=!1,spiral:a=!1,proseBoost:c=!1,proseLayers:l=!1,literalMention:u=!1,rawQuery:d=""}=n,p=Number.isFinite(n.beamWidth)&&n.beamWidth>0?n.beamWidth:8,f=Bh(e),m=[];for(let E of e.individuals){if((E.class||"")!=="Module")continue;let _=String(E.label),v=_.toLowerCase(),S=f.get(E.id)||[],C=new Set(S.map(w=>w.toLowerCase())),x=new Set;for(let w of S)for(let T of Ih(w))x.add(T);let R=u?String((E.attributes||[]).find(w=>w.key==="dotted")?.value||"").toLowerCase():"";m.push({ind:E,label:_,labelLc:v,defines:S,symSet:C,symComps:x,dotted:R})}let h=m.length||1,g=new Map,b=E=>{let _=0;for(let v of m)(v.labelLc.includes(E)||v.symComps.has(E)||v.symSet.has(E))&&_++;return _},y=E=>(g.has(E)||g.set(E,yu(h,b(E))),g.get(E));for(let E of t)y(E);let $=[];for(let E of m){let _=0,v=0,S=0,C=[];for(let I of t){let j=g.get(I)||0;j&&(E.symSet.has(I)?(_+=j*Wh,S++):E.symComps.has(I)&&(C.push(j),S++),E.labelLc.includes(I)&&(v+=j*Gj))}C.sort((I,j)=>j-I);let x=0;for(let I=0;I<Math.min(C.length,Hj);I++)x+=C[I]*Vj;let R=_+v+x;if(!R)continue;s&&(Eo(E.labelLc)||Xj(E.labelLc))?R*=Yj:Eo(E.labelLc)&&(R*=.4);let w=E.defines.filter(I=>{let j=I.toLowerCase(),k=Ih(I);return t.some(P=>j===P||k.has(P))}),T=E.defines.length?S/E.defines.length:0;$.push({ind:E.ind,score:R,defineCount:E.defines.length,matching:w,density:T})}if(u&&d&&$.length){let E=String(d).toLowerCase(),_=x=>x!=null&&/[a-z0-9_./]/.test(x),v=x=>{for(let R=E.indexOf(x);R!==-1;R=E.indexOf(x,R+1))if(!_(E[R-1])&&!_(E[R+x.length]))return!0;return!1},S=new Map(m.map(x=>[x.ind.id,x])),C=0;for(let x of $)C=Math.max(C,x.score);for(let x of $){let R=S.get(x.ind.id);if(!R)continue;let w=0;for(let T of new Set([R.dotted,R.labelLc])){if(!T||T.split(/[./]+/).filter(Boolean).length<uk||!v(T))continue;let I=[...new Set(T.split(/[^a-z0-9_]+/).filter(Boolean))].map(y).sort((k,P)=>P-k),j=0;for(let k=0;k<Math.min(I.length,dk);k++)j+=I[k]*lk;w=Math.max(w,j)}w&&(x.score+=Math.min(w*fk,C*pk))}}if($.length>1){let E=new Map($.map(v=>[v.ind.id,v.score])),_=new Map;for(let v of _e(e,"imports"))!E.has(v.subject)&&!E.has(v.object)||(_.has(v.subject)||_.set(v.subject,new Set),_.has(v.object)||_.set(v.object,new Set),_.get(v.subject).add(v.object),_.get(v.object).add(v.subject));for(let v of $){let S=0;for(let C of _.get(v.ind.id)||[])S=Math.max(S,E.get(C)||0);v.score+=Math.min(S*qj,v.score*Kj)}}if(o&&$.length>1){let E=new Map($.map(v=>[v.ind.id,v.score])),_=new Map;for(let v of["calls","callsSymbol"])for(let S of _e(e,v)){let C=$s(e,S.subject),x=$s(e,S.object);!C||!x||C===x||!E.has(C)&&!E.has(x)||(_.has(C)||_.set(C,new Set),_.has(x)||_.set(x,new Set),_.get(C).add(x),_.get(x).add(C))}for(let v of $){let S=0;for(let C of _.get(v.ind.id)||[])S=Math.max(S,E.get(C)||0);v.score+=Math.min(S*Jj,v.score*Qj)}}if(r&&$.length>1){let E=new Map($.map(v=>[v.ind.id,v.score])),_=new Map;for(let v of e.individuals)(v.class||"")==="Class"&&v.label&&_.set(String(v.label),v);for(let v of $){if(!tk(v.ind.label))continue;let S=0;for(let C of _e(e,"inherits")){if($s(e,C.subject)!==v.ind.id||!nk(C.objectLabel))continue;let R=$s(e,C.object);if(!R){let w=_.get(String(C.objectLabel||""));w&&(R=Xn(e,w))}R&&(S=Math.max(S,E.get(R)||0))}v.score+=Math.min(S*Zj,v.score*ek)}}if(c&&$.length&&e.proseIndex){let E=xo(e.proseIndex,t.join(" "),{limit:rk});if(E.length){let _=new Map;for(let{id:v,score:S}of E){let C=$s(e,v);C&&_.set(C,(_.get(C)||0)+S)}for(let v of $){let S=_.get(v.ind.id)||0;S&&(v.score+=Math.min(S*sk,v.score*ok))}}}if(l&&$.length&&e.proseIndex){let E=new Map($.map(S=>[S.ind.id,S])),_=new Map(m.map(S=>[S.ind.id,S])),v=new Map;for(let S of new Set(t)){let C=g.get(S)||0;if(!C)continue;let{ids:x}=fh(e.proseIndex,S);if(!x.length)continue;let R=new Set;for(let w of x){let T=$s(e,w);if(!T||R.has(T)||(R.add(T),!E.has(T)))continue;let I=_.get(T);I&&(I.symSet.has(S)||I.symComps.has(S)||I.labelLc.includes(S))||v.set(T,(v.get(T)||0)+C*ck)}}for(let S of $){let C=v.get(S.ind.id)||0;C&&(S.score+=Math.min(C*ik,S.score*ak))}}return i&&$.length>1&&Sk(e,$,p),a&&$.length&&jk(e,$,{depth:Number.isFinite(n.spiralDepth)&&n.spiralDepth>0?n.spiralDepth:Gh,q:Number.isFinite(n.mostDistinctiveBeams)&&n.mostDistinctiveBeams>0?n.mostDistinctiveBeams:Hh,nodeLimit:Number.isFinite(n.spiralNodeLimit)&&n.spiralNodeLimit>0?n.spiralNodeLimit:Vh}),$.sort((E,_)=>_.score-E.score||_.density-E.density||E.defineCount-_.defineCount||String(E.ind.label).length-String(_.ind.label).length),$}function Yh(e,t,n={}){let s=String(t||""),o=s.toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean);if(!o.length)return[];let r=n.literalMention?{...n,rawQuery:s}:n;return Kh(e,o,r).map(i=>({path:String(i.ind.label),score:i.score}))}function Rk(e){let t=0,n=!1,s=!1,o=!1,r="",i=!1,a=()=>{t+=1,r===")"&&(n=!0),i=!0};for(let c=0;c<e.length;c++){let l=e[c];if(l==="\\"){let u=e[c+1]||"";!o&&u>="1"&&u<="9"&&(s=!0),c+=1,r="",i=!1;continue}if(o){l==="]"&&(o=!1,r="]",i=!1);continue}if(l==="["){o=!0,r="[",i=!1;continue}if(l==="?"&&(r==="("||i)){r="?",i=!1;continue}if(l==="*"||l==="+"||l==="?"){a(),r=l;continue}if(l==="{"){let u=e.indexOf("}",c),d=u===-1?"":e.slice(c+1,u);if(u!==-1&&/^\d+(,\d*)?$/.test(d)){a(),c=u,r="}";continue}r="{",i=!1;continue}r=l,i=!1}return{quantifiers:t,quantifiedGroup:n,backreference:s}}function _u(e,{now:t=Date.now}={}){let n=String(e);if(n.length>Oh)return{error:`name pattern is ${n.length} characters; the limit is ${Oh}.`};let{quantifiers:s,quantifiedGroup:o,backreference:r}=Rk(n);if(o)return{error:`name pattern "${n}" quantifies a group, which can backtrack for minutes on one label. Quantify a character or a class instead.`};if(r)return{error:`name pattern "${n}" uses a back-reference, which can backtrack for minutes on one label.`};if(s>Nh)return{error:`name pattern "${n}" has ${s} quantifiers; the limit is ${Nh}.`};let i;try{i=new RegExp(n,"i")}catch{return{error:`invalid name pattern: ${n}`}}let a=null;return{test(c){if(a===null)a=t()+Lh;else if(t()>a)throw new Ca(`name pattern "${n}" exceeded its ${Lh}ms matching budget.`);return i.test(String(c).slice(0,kk))}}}function Xh(e,t,{limit:n=Oa,kind:s="",decorator:o="",name:r="",toolNamePrefix:i="tmct_"}={}){let a=String(t||"").toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean),c=String(s||"").trim().toLowerCase(),l=String(o||"").trim().toLowerCase(),u=null;if(r){let m=_u(r);if(m.error)return m.error;u=m}if(c&&c!=="module")try{return Ik(e,a,{limit:n,kind:c,decFilter:l,nameRe:u,toolNamePrefix:i})}catch(m){if(m instanceof Ca)return m.message;throw m}if(!a.length&&!u&&!l)return"empty query";let d=Kh(e,a);if(!d.length)return`no module matches "${t}". Try broader keywords, or ${i}describe <path> if you know where it lives.`;let p=d.slice(0,n),f=[`${d.length} module(s) match "${t}" (top ${p.length}):`];for(let{ind:m,defineCount:h,matching:g}of p){let b=g.length?` \u2014 matching: ${vt([...new Set(g)],Wj)}`:"";f.push(`- ${m.label} (defines ${h} symbol(s))${b}`)}return f.push(`Then ${i}describe <path> for the full sibling list + typed edges, or ${i}impact <path> for dependents.`),f.join(`
4
+ `)}function _e(e,t){let n=Ph.get(e);n||(n=new Map,Ph.set(e,n));let s=n.get(t);if(s)return s;let o=[];for(let r of e.relations)if(xs(r)===t)for(let i of r.edges)o.push(i);return n.set(t,o),o}function $s(e,t){let n=e.byId?.get?.(t);if(n)return Xn(e,n);let s=String(t||"").match(/^fn:(.+)#/);return s?`mod:${s[1]}`:null}function Xn(e,t){if((t?.class||"")==="Module")return t.id;let n=Vt(t);if(n)return`mod:${n.path}`;let s=String(t?.id||"").match(/^fn:(.+)#/);return s?`mod:${s[1]}`:null}function Tu(e){if(!e)return"";let t=e.end>e.start?`${e.start}-${e.end}`:`${e.start}`;return` [${e.path}:${t}]`}function ur(e){return(e?.attributes||[]).find(t=>t.key==="decorators")?.value||""}function Jh(e,t,{toolNamePrefix:n="tmct_"}={}){let s=[`${t.label} \u2014 ${vs(t.class)} (id: ${t.id})`],o=_e(e,"contains").filter(a=>a.subject===t.id);if(!o.length)return s.push(`members: none recorded (empty class, or members not in the extracted graph). Use ${n}describe for its edges.`),s.join(`
5
+ `);let r=[],i=[];for(let a of o){let c=e.byId.get(a.object),l=Tu(c?Vt(c):null),u=c?ur(c):"",d=`${a.objectLabel||a.object}${l}${u?` @${u}`:""}`;((c?.class||"")==="Attribute"?i:r).push(d)}return r.length&&s.push(`methods (${r.length}): ${vt(r,Mh)}`),i.length&&s.push(`attributes (${i.length}): ${vt(i,Mh)}`),s.push(`Use ${n}snippet <Class.member> for an exact body.`),s.join(`
6
+ `)}function Qh(e,t,{toolNamePrefix:n="tmct_"}={}){let s=Vt(t),o=[`${t.label} \u2014 ${vs(t.class)}${Tu(s)}`],r=He(t,"params"),i=He(t,"returns");(r||i||(t.class||"")==="Method"||(t.class||"")==="Function")&&o.push(`signature: ${t.label}(${r})${i?` -> ${i}`:""}`);let a=[];He(t,"isStatic")&&a.push("static"),He(t,"isAbstract")&&a.push("abstract"),He(t,"isConstant")&&a.push("constant");let c=He(t,"visibility");c&&a.push(c),a.length&&o.push(`flags: ${a.join(", ")}`);let l=ur(t);l&&o.push(`decorators: @${l.split(", ").join(", @")}`);let u=He(t,"raises");u&&o.push(`raises: ${u}`);let d=He(t,"catches");d&&o.push(`catches: ${d}`);let p=He(t,"self_fields");p&&o.push(`self fields: ${p}`);let f=He(t,"value");f&&o.push(`value: ${f}`);let m=He(t,"doc");return m&&o.push(`doc: ${m}`),o.length===1&&o.push(`(no signature detail recorded for this symbol \u2014 likely a module or attribute; use ${n}snippet for its source.)`),o.push(`Use ${n}snippet for the exact body.`),o.join(`
7
+ `)}function Zh(e,t){let n=_e(e,"inherits"),s=n.filter(c=>c.subject===t.id).map(c=>c.objectLabel||c.object),o=new Map;for(let c of n)o.has(c.object)||o.set(c.object,[]),o.get(c.object).push({id:c.subject,label:c.subjectLabel||c.subject});let r=[`${t.label} \u2014 ${vs(t.class)} (id: ${t.id})`];r.push(s.length?`extends: ${vt(s,Fh)}`:"extends: (no internal/recorded base classes)");let i=[];for(let c of Ta(t.id,l=>o.get(l)||[],{maxDepth:8,keyOf:l=>l.id}))c.length&&i.push(c.map(l=>l.label).sort((l,u)=>String(l).localeCompare(String(u))));let a=i.reduce((c,l)=>c+l.length,0);return a?(r.push(`subclasses: ${a} total across ${i.length} level(s).`),i.forEach((c,l)=>r.push(` depth ${l+1} (${c.length}): ${vt(c,Fh)}`))):r.push("subclasses: none recorded \u2014 nothing extends it in the extracted graph."),r.join(`
8
+ `)}function Na(e){let t=new Map;for(let n of e){let s=n.label.includes("/")?n.label.slice(0,n.label.lastIndexOf("/")):"(root)";t.set(s,(t.get(s)||0)+1)}return t}function La(e,t=""){let n=jn(t);return e.individuals.filter(s=>(s.class||"")==="Module"&&(!n||jn(s.label).startsWith(n)))}function eg(e,{pkg:t=""}={}){let n=jn(t),s=La(e,t);if(!s.length)return n?`no modules under "${t}".`:"no modules in the graph.";let o=Na(s),r=new Map;for(let u of _e(e,"imports"))r.set(u.object,(r.get(u.object)||0)+1);let i=new Set(s.map(u=>u.id)),a=[...r.entries()].filter(([u])=>i.has(u)).sort((u,d)=>d[1]-u[1]).slice(0,Tk).map(([u,d])=>`${e.byId.get(u)?.label||u} (${d} importers)`),c=[...o.entries()].sort((u,d)=>d[1]-u[1]),l=[`Architecture${n?` of ${t}`:""}: ${s.length} module(s) in ${c.length} package(s).`];return l.push(`packages (by module count): ${vt(c.map(([u,d])=>`${u} (${d})`),_k)}`),l.push(a.length?`hub modules (most imported): ${a.join(", ")}`:"hub modules: none (no internal imports recorded)."),l.join(`
9
+ `)}function ng(e,t){let n=Xn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||Vt(t)?.path||n,o=[...new Set(_e(e,"tests").filter(a=>a.object===n).map(a=>a.subjectLabel||a.subject))],r=o.length>0,i=r?`covered by ${o.length} test module(s):
10
+ ${vt(o,tg,`
11
11
  `)}`:"no covering tests recorded (no test module imports it).";return n===t.id?`${s}: ${i}`:`${t.label} is defined in ${s}, which ${r?"is":"has"} ${i}
12
- ${kk}`}function eg(e,{codeDomainActive:t=null}={}){let n=t??ri(e)>0,s=new Set,o=new Set;for(let a of _e(e,"tests"))s.add(a.object),o.add(a.subject);let r=e.individuals.filter(a=>(a.class||"")==="Module"&&!o.has(a.id)&&!xo(String(a.label).toLowerCase()));if(!r.length)return n?ri(e)===0?`no modules to check for test coverage in this index. ${Su}`:"no source modules to check for test coverage in this index \u2014 only test modules are recorded.":"this session holds no graph to check test coverage against.";let i=r.filter(a=>!s.has(a.id)).map(a=>a.label).sort();return i.length?`${i.length} source module(s) with no covering test module:
13
- ${vt(i,Qh,`
14
- `)}`:"every source module has at least one covering test module."}function tg(e,t){let n=Xn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=_e(e,"touches").filter(r=>r.object===n).map(r=>r.subjectLabel||r.subject);return o.length?`${s}: touched by ${o.length} recent commit(s): ${vt(o,tn)}`:`${s}: no commit history recorded (outside the git-log window or unmodified).`}function sg(e,t,{toolNamePrefix:n="tmct_"}={}){if(ng.has(t.class)){let i=[...new Set(_e(e,"callsSymbol").filter(a=>a.object===t.id).map(a=>a.subjectLabel||a.subject))];return i.length?`${t.label} \u2014 called by ${i.length} symbol(s):
12
+ ${Ak}`}function sg(e,{codeDomainActive:t=null}={}){let n=t??ri(e)>0,s=new Set,o=new Set;for(let a of _e(e,"tests"))s.add(a.object),o.add(a.subject);let r=e.individuals.filter(a=>(a.class||"")==="Module"&&!o.has(a.id)&&!Eo(String(a.label).toLowerCase()));if(!r.length)return n?ri(e)===0?`no modules to check for test coverage in this index. ${ku}`:"no source modules to check for test coverage in this index \u2014 only test modules are recorded.":"this session holds no graph to check test coverage against.";let i=r.filter(a=>!s.has(a.id)).map(a=>a.label).sort();return i.length?`${i.length} source module(s) with no covering test module:
13
+ ${vt(i,tg,`
14
+ `)}`:"every source module has at least one covering test module."}function og(e,t){let n=Xn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=_e(e,"touches").filter(r=>r.object===n).map(r=>r.subjectLabel||r.subject);return o.length?`${s}: touched by ${o.length} recent commit(s): ${vt(o,nn)}`:`${s}: no commit history recorded (outside the git-log window or unmodified).`}function ig(e,t,{toolNamePrefix:n="tmct_"}={}){if(rg.has(t.class)){let i=[...new Set(_e(e,"callsSymbol").filter(a=>a.object===t.id).map(a=>a.subjectLabel||a.subject))];return i.length?`${t.label} \u2014 called by ${i.length} symbol(s):
15
15
  ${vt(i,ii,`
16
16
  `)}`:`${t.label}: no recorded callers (fine-grained call edges are conservative \u2014 absence is not proof). Try ${n}impact for the full reverse closure.`}let s=Xn(e,t);if(!s)return`cannot map ${t.label} to a module.`;let o=e.byId.get(s)?.label||s,r=[...new Set(_e(e,"calls").filter(i=>i.object===s).map(i=>i.subjectLabel||i.subject))];return r.length?`${o} \u2014 called by ${r.length} module(s):
17
17
  ${vt(r,ii,`
18
- `)}`:`${o}: no recorded callers (calls are coarse/import-backed \u2014 absence is not proof). Try ${n}impact for the full reverse closure.`}function og(e,t){if(ng.has(t.class)){let r=[...new Set(_e(e,"callsSymbol").filter(i=>i.subject===t.id).map(i=>i.objectLabel||i.object))];return r.length?`${t.label} \u2014 calls into ${r.length} symbol(s):
18
+ `)}`:`${o}: no recorded callers (calls are coarse/import-backed \u2014 absence is not proof). Try ${n}impact for the full reverse closure.`}function ag(e,t){if(rg.has(t.class)){let r=[...new Set(_e(e,"callsSymbol").filter(i=>i.subject===t.id).map(i=>i.objectLabel||i.object))];return r.length?`${t.label} \u2014 calls into ${r.length} symbol(s):
19
19
  ${vt(r,ii,`
20
20
  `)}`:`${t.label}: no recorded callees (calls only stdlib/external, or fine-grained call edges are not in the extracted graph).`}let n=Xn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=[...new Set(_e(e,"calls").filter(r=>r.subject===n).map(r=>r.objectLabel||r.object))];return o.length?`${s} \u2014 calls into ${o.length} module(s):
21
21
  ${vt(o,ii,`
22
- `)}`:`${s}: no recorded callees.`}function rg(e,t){let n=e.byId.get(t.object),s=n?Vt(n):null;return`${t.objectLabel||n?.label||t.object}${s?` [${s.path}:${s.start}]`:""}`}function _u(e,t){if(!t?.id)return"";let n=_e(e,"callsSymbol").filter(s=>s.subject===t.id);return n.length?`calls in-repo: ${vt(n.map(s=>rg(e,s)),Rk)}`:""}function ig(e,t){let n=_e(e,"callsSymbol").filter(o=>o.subject===t.id);if(!n.length)return`${t.label} \u2014 ${vs(t.class)}: no in-repo calls recorded (calls only stdlib/external, or fine-grained call edges are not in the extracted graph).`;let s=n.map(o=>rg(e,o));return`${t.label} \u2014 ${vs(t.class)} calls ${n.length} in-repo symbol(s):
22
+ `)}`:`${s}: no recorded callees.`}function cg(e,t){let n=e.byId.get(t.object),s=n?Vt(n):null;return`${t.objectLabel||n?.label||t.object}${s?` [${s.path}:${s.start}]`:""}`}function Au(e,t){if(!t?.id)return"";let n=_e(e,"callsSymbol").filter(s=>s.subject===t.id);return n.length?`calls in-repo: ${vt(n.map(s=>cg(e,s)),Ck)}`:""}function lg(e,t){let n=_e(e,"callsSymbol").filter(o=>o.subject===t.id);if(!n.length)return`${t.label} \u2014 ${vs(t.class)}: no in-repo calls recorded (calls only stdlib/external, or fine-grained call edges are not in the extracted graph).`;let s=n.map(o=>cg(e,o));return`${t.label} \u2014 ${vs(t.class)} calls ${n.length} in-repo symbol(s):
23
23
  ${vt(s,ii,`
24
- `)}`}function ag(e,t,n){let s=e.byId.get(t),o=s?.label||n||t,r=He(s,"commitDate")||He(s,"date"),i=He(s,"commitAuthor")||He(s,"author"),a=He(s,"commitMessage")||He(s,"message"),c=[o,r,i].filter(Boolean).join(" ");return a?`${c} \u2014 ${a}`:c}function cg(e,t){let n=Xn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=_e(e,"touches").filter(a=>a.object===n);if(!o.length)return`${s}: no commit history recorded (outside the git-log window or unmodified).`;let r=o.slice(0,tn).map(a=>` ${ag(e,a.subject,a.subjectLabel)}`),i=o.length>tn?`
25
- \u2026+${o.length-tn} more`:"";return`${s}: touched by ${o.length} recent commit(s):
24
+ `)}`}function ug(e,t,n){let s=e.byId.get(t),o=s?.label||n||t,r=He(s,"commitDate")||He(s,"date"),i=He(s,"commitAuthor")||He(s,"author"),a=He(s,"commitMessage")||He(s,"message"),c=[o,r,i].filter(Boolean).join(" ");return a?`${c} \u2014 ${a}`:c}function dg(e,t){let n=Xn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=_e(e,"touches").filter(a=>a.object===n);if(!o.length)return`${s}: no commit history recorded (outside the git-log window or unmodified).`;let r=o.slice(0,nn).map(a=>` ${ug(e,a.subject,a.subjectLabel)}`),i=o.length>nn?`
25
+ \u2026+${o.length-nn} more`:"";return`${s}: touched by ${o.length} recent commit(s):
26
26
  ${r.join(`
27
- `)}${i}`}function lg(e,t){let n=_e(e,"touchesSymbol").filter(r=>r.object===t.id);if(!n.length)return`${t.label} \u2014 ${vs(t.class)}: no symbol-level commit history recorded (outside the git-log window, or fine-grained history is not in the extracted graph).`;let s=n.slice(0,tn).map(r=>` ${ag(e,r.subject,r.subjectLabel)}`),o=n.length>tn?`
28
- \u2026+${n.length-tn} more`:"";return`${t.label} \u2014 ${vs(t.class)}: touched by ${n.length} commit(s):
27
+ `)}${i}`}function fg(e,t){let n=_e(e,"touchesSymbol").filter(r=>r.object===t.id);if(!n.length)return`${t.label} \u2014 ${vs(t.class)}: no symbol-level commit history recorded (outside the git-log window, or fine-grained history is not in the extracted graph).`;let s=n.slice(0,nn).map(r=>` ${ug(e,r.subject,r.subjectLabel)}`),o=n.length>nn?`
28
+ \u2026+${n.length-nn} more`:"";return`${t.label} \u2014 ${vs(t.class)}: touched by ${n.length} commit(s):
29
29
  ${s.join(`
30
- `)}${o}`}function ug(e,t){return lg(e,t)}function dg(e,t){return lg(e,t)}function Tu(e,t,{kind:n,decFilter:s="",nameRe:o=null}={}){let r=fg[n];if(!r)return[];let i=[];for(let a of e.individuals){if((a.class||"")!==r||o&&!o.test(a.label)||s&&!lr(a).toLowerCase().includes(s))continue;let c=String(a.label).toLowerCase(),l=t.length?0:1;for(let u of t)c.includes(u)&&(l+=5);t.length&&!l||i.push({ind:a,score:l})}return i.sort((a,c)=>c.score-a.score||String(a.ind.label).length-String(c.ind.label).length),i}function _k(e,t,{limit:n=Aa,kind:s,decFilter:o,nameRe:r,toolNamePrefix:i="tmct_"}){if(!fg[s])return`unknown kind "${s}" (use function, class, method, attribute, or module).`;let c=Tu(e,t,{kind:s,decFilter:o,nameRe:r});if(!c.length)return`no ${s} matches the given filters.`;let l=c.slice(0,n),u=[`${c.length} ${s}(s) match (top ${l.length}):`];for(let{ind:d}of l)u.push(`- ${d.label}${Ru(Vt(d))}`);return u.push(`Then ${i}snippet <name> for the exact body, or ${i}describe for its edges.`),u.join(`
31
- `)}function Fk(e){return{paramCount:Oa(e?.params),hasReturns:!!e?.returns,hasRaises:!!e?.raises,callees:e?.callees instanceof Set?e.callees:new Set}}function Dk(e){if(!e.length)return{paramCount:0,hasReturns:!1,hasRaises:!1,callees:new Set};let t=e.map(i=>Oa(i.params)),n=e.filter(i=>!!i.returns).length,s=e.filter(i=>!!i.raises).length,o=new Map;for(let i of e)for(let a of i.callees||[])o.set(a,(o.get(a)||0)+1);let r=new Set([...o.entries()].filter(([,i])=>i>=2).map(([i])=>i));return{paramCount:Mk(t),hasReturns:n*2>=e.length,hasRaises:s*2>=e.length,callees:r}}function zk(e,t){if(!t)return 0;let n=Math.max(0,4-Math.abs(Oa(e.params)-t.paramCount));!!e.returns===t.hasReturns&&(n+=2),!!e.raises===t.hasRaises&&(n+=2);let s=[...e.callees||[]].filter(o=>t.callees.has(o)).length;return n+Math.min(s,4)*2}function Uk(e,{decorators:t="",label:n="",site:s=null}={},o=null){let r=new Map;for(let p of e)for(let f of vu(p.decorators))r.set(f,(r.get(f)||0)+1);let i="",a=1;for(let[p,f]of r)f>a&&(a=f,i=p);let c=new Set(vu(t)),l=c.size?c:new Set(i?[i]:[]),u=new Set(Ph(n)),d=s?.start??null;for(let p of e){let f=vu(p.decorators).some(b=>l.has(b))?1:0,m=Ph(p.label).filter(b=>u.has(b)).length,h=zk(p,o),g=d!=null&&p.site?1/(1+Math.abs(p.site.start-d)):0;p._score=f*1e3+m*50+h+g}return[...e].sort((p,f)=>f._score-p._score||(p.site?.start||0)-(f.site?.start||0))}function dr(e,t){let n=Xn(e,t),s=e.byId.get(n)?.label||String(n||"").replace(/^mod:/,""),o=_e(e,"defines").filter(w=>w.subject===n),r=new Map;for(let w of _e(e,"callsSymbol"))r.has(w.subject)||r.set(w.subject,new Set),r.get(w.subject).add(w.object);let i=[],a=[],c=0;for(let w of o){let T=e.byId.get(w.object);if(!T)continue;let I=T.class||"",j=Vt(T);I==="GlobalVariable"?(a.push({label:T.label,value:(T.attributes||[]).find(k=>k.key==="value")?.value||"",site:j}),j&&(c=Math.max(c,j.end))):(I==="Function"||I==="Class")&&(i.push({id:T.id,label:T.label,class:I,site:j,decorators:lr(T),raises:He(T,"raises"),doc:He(T,"doc"),params:He(T,"params"),returns:He(T,"returns"),callees:r.get(T.id)||new Set}),j&&(c=Math.max(c,j.end)))}let l=Vt(t),u=l&&(t.class||"")!=="Module"?{id:t.id,label:t.label,class:t.class||"",site:l,decorators:lr(t),raises:He(t,"raises"),params:He(t,"params"),returns:He(t,"returns"),callees:r.get(t.id)||new Set}:null,d=i.length,p=u?Fk(u):Dk(i);i=Uk(i,u||{label:t.label},p);let f=u?null:i.find(w=>w.site&&w.label!==t.label)||null,m=[...new Set(_e(e,"tests").filter(w=>w.object===n).map(w=>w.subjectLabel||w.subject))].slice(0,Ik),h=gg(e,n).slice(0,Ck),g=_e(e,"reexports").filter(w=>w.subject===n).map(w=>w.objectLabel||w.object).slice(0,20),b=He(e.byId.get(n),"all"),y=_e(e,"contains"),$=null;(t.class||"")==="Class"?$=t.id:(t.class||"")==="Method"&&($=y.find(w=>w.object===t.id)?.subject||null);let E=null;if($){let w=e.byId.get($),T=y.filter(I=>I.subject===$).map(I=>{let j=e.byId.get(I.object);return{label:I.objectLabel||j?.label||I.object,class:j?.class||"",site:j?Vt(j):null,decorators:j?lr(j):"",params:j?He(j,"params"):"",returns:j?He(j,"returns"):"",raises:j?He(j,"raises"):""}}).slice(0,Ak);E={className:w?.label||String($).replace(/^fn:.*#/,""),members:T,total:y.filter(I=>I.subject===$).length}}let _=null;for(let w of[...i,...a])w.site&&(!_||w.site.start>_.start)&&(_=w.site);let v=_?{start:_.start,end:_.end}:null,S=u||f,C=S?.id?e.byId.get(S.id):null,x=C?_u(e,C):"",R=[];if(S?.callees)for(let w of S.callees){let T=e.byId.get(w),I=T?Vt(T):null;if(I&&R.push({label:T.label,site:I}),R.length>=Pk)break}return{modId:n,moduleLabel:s,anchor:u,siblings:i,totalSiblings:d,exemplar:f,globals:a,tests:m,cochange:h,exports:g,allExports:b,classMembers:E,insertion:c,insertionRegion:v,calleeBodies:R,callHint:x,siblingCap:Tk}}function Eo(e){let t={anchor:!0,exemplar:!0,registration:!0,insertionRegion:!0,allExports:!0,classMembers:!0,siblings:!0,reexports:!0,tests:!0,cochange:!0,inlinedCallees:!1};return e==="TINY"?{...t,classMembers:!1,siblings:!1,reexports:!1,tests:!1,cochange:!1}:e==="LARGE"||e==="FULL"?{...t,inlinedCallees:!0}:t}function pg(e){return{...e,anchor:!1,exemplar:!1,inlinedCallees:!1,classMembers:!1,reexports:!1,tests:!1,cochange:!1,registration:!0,siblings:!0,insertionRegion:!0,allExports:!0}}function Na(e,t,{untuned:n=!1}={}){let s=e.anchor||e.exemplar,o="TINY";if(e.anchor&&e.anchor.site||e.exemplar&&e.exemplar.site||(o="MID"),e.classMembers&&e.classMembers.members&&e.classMembers.members.length&&(o="MID"),s){let i=s.site?s.site.end-s.site.start+1:1/0,a=Oa(s.params);(i>Ok||a>Nk||s.raises)&&(o="MID");let c=!1;if(e.anchor)for(let u of s.callees||[]){let d=t.byId.get(u),p=d?Vt(d):null;if(p&&p.path!==e.moduleLabel){c=!0;break}}let l=(e.anchor?.class||"")==="Method"&&Number(e.classMembers?.total||e.classMembers?.members?.length||0)>=Lk;(c||l)&&(o="LARGE")}else o="MID";return{tier:o,mask:Eo(o),topup:o!=="TINY"}}function mg(e){let t=[`Additional context for ${e.moduleLabel} (sections omitted from the lean bundle):`];if(e.classMembers&&e.classMembers.members.length){t.push(`
30
+ `)}${o}`}function pg(e,t){return fg(e,t)}function mg(e,t){return fg(e,t)}function Cu(e,t,{kind:n,decFilter:s="",nameRe:o=null}={}){let r=hg[n];if(!r)return[];let i=[];for(let a of e.individuals){if((a.class||"")!==r||o&&!o.test(a.label)||s&&!ur(a).toLowerCase().includes(s))continue;let c=String(a.label).toLowerCase(),l=t.length?0:1;for(let u of t)c.includes(u)&&(l+=5);t.length&&!l||i.push({ind:a,score:l})}return i.sort((a,c)=>c.score-a.score||String(a.ind.label).length-String(c.ind.label).length),i}function Ik(e,t,{limit:n=Oa,kind:s,decFilter:o,nameRe:r,toolNamePrefix:i="tmct_"}){if(!hg[s])return`unknown kind "${s}" (use function, class, method, attribute, or module).`;let c=Cu(e,t,{kind:s,decFilter:o,nameRe:r});if(!c.length)return`no ${s} matches the given filters.`;let l=c.slice(0,n),u=[`${c.length} ${s}(s) match (top ${l.length}):`];for(let{ind:d}of l)u.push(`- ${d.label}${Tu(Vt(d))}`);return u.push(`Then ${i}snippet <name> for the exact body, or ${i}describe for its edges.`),u.join(`
31
+ `)}function Bk(e){return{paramCount:Pa(e?.params),hasReturns:!!e?.returns,hasRaises:!!e?.raises,callees:e?.callees instanceof Set?e.callees:new Set}}function Wk(e){if(!e.length)return{paramCount:0,hasReturns:!1,hasRaises:!1,callees:new Set};let t=e.map(i=>Pa(i.params)),n=e.filter(i=>!!i.returns).length,s=e.filter(i=>!!i.raises).length,o=new Map;for(let i of e)for(let a of i.callees||[])o.set(a,(o.get(a)||0)+1);let r=new Set([...o.entries()].filter(([,i])=>i>=2).map(([i])=>i));return{paramCount:Uk(t),hasReturns:n*2>=e.length,hasRaises:s*2>=e.length,callees:r}}function Gk(e,t){if(!t)return 0;let n=Math.max(0,4-Math.abs(Pa(e.params)-t.paramCount));!!e.returns===t.hasReturns&&(n+=2),!!e.raises===t.hasRaises&&(n+=2);let s=[...e.callees||[]].filter(o=>t.callees.has(o)).length;return n+Math.min(s,4)*2}function Vk(e,{decorators:t="",label:n="",site:s=null}={},o=null){let r=new Map;for(let p of e)for(let f of Eu(p.decorators))r.set(f,(r.get(f)||0)+1);let i="",a=1;for(let[p,f]of r)f>a&&(a=f,i=p);let c=new Set(Eu(t)),l=c.size?c:new Set(i?[i]:[]),u=new Set(Dh(n)),d=s?.start??null;for(let p of e){let f=Eu(p.decorators).some(b=>l.has(b))?1:0,m=Dh(p.label).filter(b=>u.has(b)).length,h=Gk(p,o),g=d!=null&&p.site?1/(1+Math.abs(p.site.start-d)):0;p._score=f*1e3+m*50+h+g}return[...e].sort((p,f)=>f._score-p._score||(p.site?.start||0)-(f.site?.start||0))}function fr(e,t){let n=Xn(e,t),s=e.byId.get(n)?.label||String(n||"").replace(/^mod:/,""),o=_e(e,"defines").filter(w=>w.subject===n),r=new Map;for(let w of _e(e,"callsSymbol"))r.has(w.subject)||r.set(w.subject,new Set),r.get(w.subject).add(w.object);let i=[],a=[],c=0;for(let w of o){let T=e.byId.get(w.object);if(!T)continue;let I=T.class||"",j=Vt(T);I==="GlobalVariable"?(a.push({label:T.label,value:(T.attributes||[]).find(k=>k.key==="value")?.value||"",site:j}),j&&(c=Math.max(c,j.end))):(I==="Function"||I==="Class")&&(i.push({id:T.id,label:T.label,class:I,site:j,decorators:ur(T),raises:He(T,"raises"),doc:He(T,"doc"),params:He(T,"params"),returns:He(T,"returns"),callees:r.get(T.id)||new Set}),j&&(c=Math.max(c,j.end)))}let l=Vt(t),u=l&&(t.class||"")!=="Module"?{id:t.id,label:t.label,class:t.class||"",site:l,decorators:ur(t),raises:He(t,"raises"),params:He(t,"params"),returns:He(t,"returns"),callees:r.get(t.id)||new Set}:null,d=i.length,p=u?Bk(u):Wk(i);i=Vk(i,u||{label:t.label},p);let f=u?null:i.find(w=>w.site&&w.label!==t.label)||null,m=[...new Set(_e(e,"tests").filter(w=>w.object===n).map(w=>w.subjectLabel||w.subject))].slice(0,Pk),h=yg(e,n).slice(0,Lk),g=_e(e,"reexports").filter(w=>w.subject===n).map(w=>w.objectLabel||w.object).slice(0,20),b=He(e.byId.get(n),"all"),y=_e(e,"contains"),$=null;(t.class||"")==="Class"?$=t.id:(t.class||"")==="Method"&&($=y.find(w=>w.object===t.id)?.subject||null);let E=null;if($){let w=e.byId.get($),T=y.filter(I=>I.subject===$).map(I=>{let j=e.byId.get(I.object);return{label:I.objectLabel||j?.label||I.object,class:j?.class||"",site:j?Vt(j):null,decorators:j?ur(j):"",params:j?He(j,"params"):"",returns:j?He(j,"returns"):"",raises:j?He(j,"raises"):""}}).slice(0,Nk);E={className:w?.label||String($).replace(/^fn:.*#/,""),members:T,total:y.filter(I=>I.subject===$).length}}let _=null;for(let w of[...i,...a])w.site&&(!_||w.site.start>_.start)&&(_=w.site);let v=_?{start:_.start,end:_.end}:null,S=u||f,C=S?.id?e.byId.get(S.id):null,x=C?Au(e,C):"",R=[];if(S?.callees)for(let w of S.callees){let T=e.byId.get(w),I=T?Vt(T):null;if(I&&R.push({label:T.label,site:I}),R.length>=zk)break}return{modId:n,moduleLabel:s,anchor:u,siblings:i,totalSiblings:d,exemplar:f,globals:a,tests:m,cochange:h,exports:g,allExports:b,classMembers:E,insertion:c,insertionRegion:v,calleeBodies:R,callHint:x,siblingCap:Ok}}function So(e){let t={anchor:!0,exemplar:!0,registration:!0,insertionRegion:!0,allExports:!0,classMembers:!0,siblings:!0,reexports:!0,tests:!0,cochange:!0,inlinedCallees:!1};return e==="TINY"?{...t,classMembers:!1,siblings:!1,reexports:!1,tests:!1,cochange:!1}:e==="LARGE"||e==="FULL"?{...t,inlinedCallees:!0}:t}function gg(e){return{...e,anchor:!1,exemplar:!1,inlinedCallees:!1,classMembers:!1,reexports:!1,tests:!1,cochange:!1,registration:!0,siblings:!0,insertionRegion:!0,allExports:!0}}function Ma(e,t,{untuned:n=!1}={}){let s=e.anchor||e.exemplar,o="TINY";if(e.anchor&&e.anchor.site||e.exemplar&&e.exemplar.site||(o="MID"),e.classMembers&&e.classMembers.members&&e.classMembers.members.length&&(o="MID"),s){let i=s.site?s.site.end-s.site.start+1:1/0,a=Pa(s.params);(i>Mk||a>Fk||s.raises)&&(o="MID");let c=!1;if(e.anchor)for(let u of s.callees||[]){let d=t.byId.get(u),p=d?Vt(d):null;if(p&&p.path!==e.moduleLabel){c=!0;break}}let l=(e.anchor?.class||"")==="Method"&&Number(e.classMembers?.total||e.classMembers?.members?.length||0)>=Dk;(c||l)&&(o="LARGE")}else o="MID";return{tier:o,mask:So(o),topup:o!=="TINY"}}function bg(e){let t=[`Additional context for ${e.moduleLabel} (sections omitted from the lean bundle):`];if(e.classMembers&&e.classMembers.members.length){t.push(`
32
32
  ## members of ${e.classMembers.className}:`);for(let n of e.classMembers.members){let s=String(n.label).split(".").pop(),o=n.params!=null&&n.params!==""?`(${n.params})${n.returns?` -> ${n.returns}`:""}`:"",r=n.decorators?`@${n.decorators} `:"",i=n.raises?` raises=${n.raises}`:"";t.push(` ${n.class} ${s}${n.site?` :${n.site.start}`:""} ${r}${s}${o}${i}`)}}if(e.siblings.length){t.push(`
33
33
  ## sibling symbols (most relevant first; ${e.siblings.length} total):`);for(let n of e.siblings.slice(0,e.siblingCap)){let s=n.decorators?`@${n.decorators} `:"",o=n.raises?` raises=${n.raises}`:"";t.push(` ${n.class} ${n.label}${n.site?` :${n.site.start}`:""} ${s}${o}`)}e.siblings.length>e.siblingCap&&t.push(` \u2026+${e.siblings.length-e.siblingCap} more`)}return e.allExports&&t.push(`
34
34
  ## module __all__: ${e.allExports}`),e.exports&&e.exports.length&&t.push(`
35
35
  ## re-exported symbols: ${e.exports.join(", ")}`),e.tests.length&&t.push(`
36
36
  ## covering tests: ${e.tests.join(", ")}`),e.cochange&&e.cochange.length&&t.push(`
37
37
  ## usually changed together: ${e.cochange.map(n=>`${n.label} (\xD7${n.weight})`).join(", ")}`),t.length===1&&t.push("(no omitted sections \u2014 the lean bundle already contained everything for this symbol.)"),t.join(`
38
- `)}function hg(e,t){let n=[`Edit context for ${e.moduleLabel} (graph-only bundle \u2014 siblings/registration/tests are real graph truth; no source body without a source-capable provider).`];if(t.registration&&e.globals.length){n.push(`
38
+ `)}function wg(e,t){let n=[`Edit context for ${e.moduleLabel} (graph-only bundle \u2014 siblings/registration/tests are real graph truth; no source body without a source-capable provider).`];if(t.registration&&e.globals.length){n.push(`
39
39
  ## registration / module globals (replicate this pattern):`);for(let s of e.globals)n.push(` ${s.label} = ${s.value}${s.site?` [:${s.site.start}]`:""}`)}if(t.classMembers&&e.classMembers&&e.classMembers.members.length){n.push(`
40
40
  ## members of ${e.classMembers.className}:`);for(let s of e.classMembers.members){let o=String(s.label).split(".").pop(),r=s.params!=null&&s.params!==""?`(${s.params})${s.returns?` -> ${s.returns}`:""}`:"",i=s.decorators?`@${s.decorators} `:"",a=s.raises?` raises=${s.raises}`:"";n.push(` ${s.class} ${o}${s.site?` :${s.site.start}`:""} ${i}${o}${r}${a}`)}}if(t.siblings&&e.siblings.length){n.push(`
41
41
  ## sibling symbols to copy the style of (most relevant first; ${e.siblings.length} total):`);for(let s of e.siblings.slice(0,e.siblingCap)){let o=s.decorators?`@${s.decorators} `:"",r=s.raises?` raises=${s.raises}`:"";n.push(` ${s.class} ${s.label}${s.site?` :${s.site.start}`:""} ${o}${r}`)}e.siblings.length>e.siblingCap&&n.push(` \u2026+${e.siblings.length-e.siblingCap} more`)}return t.allExports&&e.allExports&&n.push(`
@@ -45,31 +45,31 @@ ${s.join(`
45
45
  ## insert the new sibling after line ~${e.insertion} (end of the last top-level definition).`)),t.tests&&e.tests.length&&n.push(`
46
46
  ## covering tests: ${e.tests.join(", ")}`),t.cochange&&e.cochange&&e.cochange.length&&n.push(`
47
47
  ## usually changed together (consider editing these too): ${e.cochange.map(s=>`${s.label} (\xD7${s.weight})`).join(", ")}`),n.join(`
48
- `)}function gg(e,t){let n=[];for(let s of _e(e,"cochange"))s.subject===t?n.push({label:s.objectLabel||s.object,weight:s.weight||0}):s.object===t&&n.push({label:s.subjectLabel||s.subject,weight:s.weight||0});return n.sort((s,o)=>o.weight-s.weight)}function bg(e,t){let n=Xn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=gg(e,n);if(!o.length)return`${s}: no change-coupling recorded (rarely co-committed, or outside the git-log window).`;let r=o.slice(0,xu).map(i=>`${i.label} (\xD7${i.weight})`);return`${s} \u2014 usually changes together with ${o.length} module(s) (edit these too):
48
+ `)}function yg(e,t){let n=[];for(let s of _e(e,"cochange"))s.subject===t?n.push({label:s.objectLabel||s.object,weight:s.weight||0}):s.object===t&&n.push({label:s.subjectLabel||s.subject,weight:s.weight||0});return n.sort((s,o)=>o.weight-s.weight)}function $g(e,t){let n=Xn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=yg(e,n);if(!o.length)return`${s}: no change-coupling recorded (rarely co-committed, or outside the git-log window).`;let r=o.slice(0,Su).map(i=>`${i.label} (\xD7${i.weight})`);return`${s} \u2014 usually changes together with ${o.length} module(s) (edit these too):
49
49
  ${r.join(`
50
- `)}`+(o.length>xu?`
51
- \u2026+${o.length-xu} more`:"")}function wg(e,t){let n=Xn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=_e(e,"reexports").filter(i=>i.subject===n);if(!o.length)return`${s}: no public exports recorded (no export list / __all__ found, or none resolved).`;let r=o.slice(0,Eu).map(i=>{let a=e.byId.get(i.object),c=a?Vt(a):null,l=c?` \u2190 ${c.path}`:"";return`${i.objectLabel||i.object}${l}`});return`${s} \u2014 public API (${o.length} export(s)):
50
+ `)}`+(o.length>Su?`
51
+ \u2026+${o.length-Su} more`:"")}function vg(e,t){let n=Xn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=_e(e,"reexports").filter(i=>i.subject===n);if(!o.length)return`${s}: no public exports recorded (no export list / __all__ found, or none resolved).`;let r=o.slice(0,ju).map(i=>{let a=e.byId.get(i.object),c=a?Vt(a):null,l=c?` \u2190 ${c.path}`:"";return`${i.objectLabel||i.object}${l}`});return`${s} \u2014 public API (${o.length} export(s)):
52
52
  ${r.join(`
53
- `)}`+(o.length>Eu?`
54
- \u2026+${o.length-Eu} more`:"")}var Su,Sh,Mh,Rh,Lj,Mj,$u,Fj,Aa,Dj,zj,Uj,zh,Bj,Wj,Gj,Vj,Hj,qj,Kj,Yj,Xj,Jj,Qj,Zj,ek,tk,nk,sk,ok,rk,ik,ak,ck,lk,uk,dk,fk,_h,pk,mk,Uh,Bh,Wh,hk,gk,bk,wk,yk,Ah,Ch,xk,Ih,_a,Oh,Nh,Lh,ii,He,Sk,jk,Qh,kk,tn,ng,Rk,fg,Tk,Ak,Ck,Ik,Ok,Nk,Lk,Pk,vu,Ph,Oa,Mk,xu,Eu,De=M(()=>{qs();Mn();gu();si();ys();Su="This store holds no code index, so it records no modules or commits to look through.",Sh={"mgx:importsnamespace":"imports","mgx:callscoarse":"calls","seon:declaresmethod":"defines","mgx:testscoverage":"tests","mgx:touchedbycommit":"touches","seon:containscodeentity":"contains","seon:hassupertype":"inherits","mgx:changecoupledwith":"cochange","mgx:reexports":"reexports","mgx:serves":"serves","mgx:denotes":"denotes","mgx:touchessymbol":"touchesSymbol","mgx:callssymbol":"callsSymbol","seon:usescomplextype":"imports","seon:invokesmethod":"calls","seon:history":"touches","mgx:subclassof":"inherits","mg:imports":"imports","mg:calls":"calls","mg:defines":"defines","mg:tests":"tests","mg:touches":"touches","mgx:saidinsession":"saidInSession","mgx:inreplyto":"inReplyTo","mgx:statedby":"statedBy","mgx:canonicalisedfrom":"canonicalisedFrom"};Mh=e=>/^(git|turn):/.test(String(e||""));Rh=30,Lj=8;Mj=2,$u=25,Fj=3;Aa=10,Dj=8,zj=3,Uj=2,zh=5,Bj=4,Wj=.2,Gj=.35,Vj=.15,Hj=e=>/(^|\/)(examples?|fixtures?|samples?|demos?|benchmarks?|test-[^/]+)(\/|$)/.test(e),qj=.2,Kj=.35,Yj=.2,Xj=.35,Jj=e=>/\.cs$/i.test(e),Qj=e=>/^I[A-Z]/.test(String(e||"")),Zj=.2,ek=.35,tk=50,nk=.2,sk=.35,ok=.5,rk=zh,ik=3,ak=4,ck=1,lk=.9,uk=.5,dk=.2,fk=.35,_h=4,pk=2,mk=[["imports"],["calls","callsSymbol"],["inherits"],["cochange"]],Uh=3,Bh=12,Wh=.9,hk=["imports","calls","callsSymbol","inherits"],gk=.5,bk=.6,wk=.2,yk=.35;Ah=128,Ch=4,xk=64,Ih=250,_a=class extends Error{};Oh=new WeakMap;Nh=40,Lh=40,ii=30;He=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value||"";Sk=25,jk=15;Qh=40,kk="tests edges are recorded module to module, so this is module-grain coverage.";tn=15;ng=new Set(["Function","Method"]);Rk=8;fg={function:"Function",class:"Class",method:"Method",attribute:"Attribute"};Tk=8,Ak=16,Ck=4,Ik=6,Ok=12,Nk=2,Lk=8,Pk=3,vu=e=>String(e||"").split(",").map(t=>t.trim()).filter(Boolean),Ph=e=>String(e||"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean),Oa=e=>{let t=String(e||"").trim();return t?t.split(",").map(n=>n.trim()).filter(Boolean).length:0},Mk=e=>{let t=new Map,n=e[0]??0,s=0;for(let o of e){let r=(t.get(o)||0)+1;t.set(o,r),r>s&&(s=r,n=o)}return n};xu=20;Eu=40});function ot(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function jg(e){let t=String(e||"");return yg&&(t=t.replace(yg," ")),t.replace(/\s+/g," ").trim()}function kg(e){let t=String(e||"");t=t.replace(iR," ").replace(/\s+/g," ").trim();for(let n=0;n<3;n++){let s=t,o=t.match(tR);if(o&&(t=o[1].trim()),o=t.match(nR),o&&(t=o[1].trim()),o=t.match($g),o&&(t=o[1].trim()),o=t.match(vg),o&&(t=o[1].trim()),o=t.match(xg),o&&(t=o[1].trim()),o=t.match(rR),o&&(t=o[1].trim()),o=t.match(Eg),o&&(t=o[1].trim()),o=t.match(aR),o&&(t=o[1].trim()),o=t.match(cR),o&&Ys.test(o[1].trim())&&(t=o[1].trim()),o=t.match(lR),o&&Ys.test(o[1].trim())&&(t=o[1].trim()),o=t.match(uR),o&&Ys.test(o[1].trim())&&(t=o[1].trim()),o=t.match(dR),o&&Ys.test(o[1].trim())&&(t=o[1].trim()),o=t.match(fR),o&&Ys.test(o[1].trim())&&(t=o[1].trim()),o=t.match(pR),o&&Ys.test(o[1].trim())&&(t=o[1].trim()),o=t.match(mR),o&&(t=`what ${o[2].toLowerCase()} ${o[1].trim()}`),o=t.match(hR),o&&(t=`what does ${o[1].trim()} mean`),o=t.match(gR),o&&(t=`what do you ${o[1].toLowerCase()} about ${o[2].trim()}`),o=t.match(bR),o){let r=o[1].trim();eR(r)||(t=!wR.test(r)&&(Jk.test(r)||Ys.test(r))?r:`describe ${r}`)}if(o=t.match(yR),o){let r=o[1].trim();(Ys.test(r)||$R.test(r)||Eg.test(r)||$g.test(r)||xg.test(r)||vg.test(r)||vR.test(r))&&(t=r)}if(t===s)break}return t}function IR(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t,o=t.match(AR);if(o&&(t=o[1].trim()),o=t.match(CR),o&&(t=o[1].trim()),t===s)break}return t}function NR(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t.match(OR);if(!s)break;let o=s[1].trim();if(!o||o===t)break;t=o}return t}function MR(e){let t=String(e||""),n=t.match(PR);if(n){let o=_g[n[1].toLowerCase()],r=Rg[n[2].toLowerCase()];return`${o} ${r} ${n[3].trim()} and ${n[4].toLowerCase()}`}let s=t.match(Tg);return s?`which modules transitively import ${s[1].trim()}`:t}function Pa(e){return String(e||"").replace(Wk,t=>cu[t.toLowerCase()])}function So(e){let t=Pa(e);return t=t.replace(Gk,n=>lu[n.toLowerCase()]),t=t.replace(Vk,n=>uu[n.toLowerCase()]),t=t.replace(Hk,"with"),t=t.replace(qk,(n,s)=>`${s} for`),t=t.replace(Kk,(n,s)=>`for ${s}`),t=t.replace(Yk,(n,s)=>s),t=t.replace(FR,"$1$2"),t=t.replace(Km,"$1ing"),t=kg(t),t=NR(t),t=IR(t),t=MR(t),t=jg(t),t=pn(t),t=t.replace(/\?{2,}\s*$/,"?"),t.replace(/\s+/g," ").trim()}function ci(e){for(let t of[...Xm,...Ym]){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function Cu(e){for(let t of DR){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function Ag(e){let t=String(e||"").match(zR);if(!t)return null;let n=t[1].toLowerCase(),s=t[2].trim();return s?{entWord:n,predicate:s}:null}var Bk,Wk,Sg,Gk,Vk,Hk,qk,Kk,Yk,Xk,yg,Jk,Ys,Qk,Zk,eR,ai,tR,nR,sR,oR,$g,vg,xg,rR,iR,aR,cR,lR,uR,dR,fR,pR,mR,hR,gR,bR,wR,yR,$R,vR,Eg,La,xR,ER,SR,jR,kR,RR,_R,AD,Au,TR,CD,ID,OD,AR,CR,OR,Rg,_g,LR,PR,Tg,FR,DR,zR,dt,nn,ge,Sn=M(()=>{Kn();Bk=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(ot).join("|")+")\\b","gi"),Wk=Bk(cu),Sg=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(ot).join("|")+")\\b(?!\\.[a-z0-9])","gi"),Gk=Sg(lu),Vk=Sg(uu),Hk=/(?<=^|\s)w\/(?=\s|$)/gi,qk=/\b(thx|thanks|thank\s+you|many\s+thanks|ty|cheers)\s+4\b/gi,Kk=/\b4\s+(example|instance)\b(?!\s*[a-z])/gi,Yk=/\b(this|that)\s+(class|module|function|method|attribute|variable|file|commit)\b/gi,Xk=Object.keys(me).sort((e,t)=>t.length-e.length).map(ot).join("|"),yg=Zr.length?new RegExp("\\b("+[...Zr].sort((e,t)=>t.length-e.length).map(ot).join("|")+")\\b\\s*,?","gi"):null;Jk=new RegExp("\\b(?:"+Object.keys(me).sort((e,t)=>t.length-e.length).map(ot).join("|")+")\\b","i"),Ys=/^(?:which|what|who|whose|where|when|why|how)\b/i,Qk=new Set(["modules","files","packages","functions","methods","classes","attributes","fields","properties","variables","globals","commits","changes","tests","members"]),Zk=/^(?:all\s+|the\s+)?(?:module|file|package|function|method|class|attribute|field|property|variable|global|commit|change|test|member)\??$/i,eR=e=>{if(Zk.test(e))return!0;let t=e.replace(/\?+\s*$/,"").trim().split(/\s+/);return Qk.has((t[t.length-1]||"").toLowerCase())},ai="[,.;:!]|\u2014|\u2013|-",tR=/^(?:hi|hiya|hello|hey|yo|howdy|g'?day|yeah\s+nah|good\s+(?:morning|afternoon|evening|day)|greetings|salutations)(?:\s+(?:there|pardner|folks|friend|mate))?\s*[,.—–-]\s*(?:(?:just\s+a\s+)?quick\s+question\s*[,:—–-]?\s*)?(.+)$/i,nR=/^(?:thanks|thank\s+you|many\s+thanks|thx|ty|cheers)(?:\s+(?:so\s+much|a\s+lot|very\s+much|a\s+bunch))?\s*[,—–-]\s*(?:(?:just\s+a\s+)?quick\s+question\s*[,:—–-]?\s*)?(.+)$/i,sR="ok(?:ay)?|aight|cool|alright|sure|right|fine|great|nice|got it|gotcha|sounds good|no worries|no problem|another\\s+one",oR="(?:just\\s+)?(?:one|another)\\s+more",$g=new RegExp(`^(?:(?:${sR})[\\s,]+|(?:${oR})\\s*(?:${ai})\\s*)+(.+)$`,"i"),vg=/^(?:just\s+(?:poking\s+around|looking\s+around|browsing|exploring|checking\s+(?:this|it)\s+out)|first\s+time\s+(?:trying\s+this\s+out|using\s+this|here)|i'?m\s+new\s+(?:here|around\s+here|to\s+(?:this|all\s+this)(?:\s+(?:repo|codebase|project|app|tool|thing))?))\s*[,.—–-]\s*(.+)$/i,xg=/^(?:(?:maybe|possibly|perhaps)\s+)+(.+)$/i,rR=/^(?:please[\s,]+)+(.+)$/i,iR=/,?\s*if\s+(?:it'?s|it\s+is|that'?s|that\s+is)\s+not\s+too\s+much\s+(?:trouble|bother|hassle)\s*,?\s*/i,aR=/^(?:can|could|would|will)\s+you\s+(?:please\s+)?(.+?)(?:[,\s]+please)?\??$/i,cR=/^explain\s+(?:to\s+me\s+|please\s+)*(.+?)\??$/i,lR=/^tell\s+me\s+(?:please\s+)?(.+?)\??$/i,uR=/^(?:(?:would|do)\s+you\s+)?mind\s+telling\s+(?:me|us)\s+(?:please\s+)?(.+?)\??$/i,dR=/^do\s+you\s+know\s+(.+?)\??$/i,fR=/^i(?:'d|\s+would)?\s+(?:(?:like|want|need)\s+to|wanna)\s+know\s+(.+?)\??$/i,pR=/^i(?:\s+was|\s+am|'m)?\s+(?:just\s+)?(?:wonder(?:ing|ed)?|curious)(?:\s+(?:if|whether|about))?\s+(.+?)\??$/i,mR=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+(is|are)\??$/i,hR=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+means\??$/i,gR=/^what\s+you\s+(know|remember)\s+about\s+(.+?)\??$/i,bR=/^(?:show|give)\s+me\s+(?:the\s+)?(.+?)\??$/i,wR=/^everything\s+i(?:'d|\s+would)?\s+need\b/i,yR=/^(?:and|also|so|then|now|but)\s+(.+)$/i,$R=/^(?:does|do|did|is|are|was|were|has|have|had|can|could|will|would|should)\b/i,vR=/^(?:the|its|their|his|her|our|my)\s+[\w'-]+(?:\s+[\w'-]+){0,2}\s+(?:that|which|who)\s+\S/i,Eg=/^(?:(?:actually|no\s+wait|wait|hold\s+on|never\s+mind|scratch\s+that|on\s+second\s+thought|i\s+mean(?:t)?)[\s,.]+)+(.+)$/i;La=e=>[...e].sort((t,n)=>n.length-t.length).map(ot).join("|"),xR=Object.freeze(["oh","ah","aha","ooh","ohh","wow","huh","hm","hmm","mm","mmm","heh","ha","yay","ugh","oof","phew","whoa","oops","yikes","oi"]),ER=Object.freeze(["nice","cool","great","neat","lovely","interesting","good","ok","okay","fair enough","makes sense","i see","got it","fine"]),SR=Object.freeze(["um","umm","uhm","uh","uhh","er","err","erm","ehm","eh","well","anyway","anyhow","anyways","regardless","moving on"]),jR=Object.freeze(["quick question","quick q","one quick question","just a quick question","random question","random thing","one more random thing","another random thing","one more thing","one last thing","last thing","one more question","side note","side question","sidebar","off topic","unrelated","on a different note","different topic","changing the subject","new topic","just curious","out of curiosity","curious","genuinely curious","while i'm here","while i have you","before i forget"]),kR=`(?:${La(xR)})(?:\\s+(?:${La(ER)}))?\\s*(?:${ai})\\s*`,RR=`(?:${La(SR)})\\s*(?:(?:${ai})\\s*|\\s+)`,_R=`(?:${La(jR)})\\s*(?:${ai})\\s*`,AD=new RegExp(`^(?:sorry\\s*(?:${ai})?\\s*)?(?:${kR}|${RR}|${_R})+`,"i"),Au="what|who|which|where|when|why|how",TR="is|are|was|were|do|does|did|can|could|should|would|will|has|have|might|must",CD=new RegExp(`\\b(?:an?|the)?\\s*(?:${Au})\\s*\\?\\s*$`,"i"),ID=new RegExp(`^(?:in|at|on|from|by|with|for|of|to|off)\\s+(?:${Au})\\b`,"i"),OD=new RegExp(`\\b(?:${Au})\\s+(?:i|you|he|she|it|we|they)?\\s*(?:${TR})\\b`,"i"),AR=/^(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+?,\s*(.+)$/i,CR=/^(.+?),\s*(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+$/i;OR=/^.+?(?:\s*(?:--|—|-)\s*)?\b(?:sorry|i\s+mean)\b\s*(?:--|—|-|,|:)\s*(.+)$/i;Rg=Object.freeze({imports:"importing",calls:"calling",touches:"touching",tests:"testing",exports:"exporting",contains:"containing",defines:"defining",uses:"using","inherits from":"inheriting from"}),_g=Object.freeze({module:"modules",class:"classes",function:"functions",method:"methods",attribute:"attributes",variable:"variables",commit:"commits",file:"files"}),LR="public|private|protected|static|abstract|constant|re-?exported|exported|tested|covered|untested|uncovered",PR=new RegExp("^if\\s+(?:a|an|the)?\\s*("+Object.keys(_g).join("|")+")\\s+("+Object.keys(Rg).join("|")+")\\s+(.+?),\\s*(?:is|are)\\s+(?:it|that|they|this)\\s+("+LR+")\\??$","i"),Tg=/^if\s+(.+?)\s+(?:were|was)\s+(?:deleted|removed),?\s*what\s+(?:would|might|could)\s+(?:break|fail|be\s+affected)\??$/i;FR=new RegExp(`^(where\\s+(?:is|are|was|were)\\s+.+?)\\s+(?:${iu.map(ot).join("|")})(\\s*[?.!]*)$`,"i");DR=Object.freeze([{re:/^what\s+(?:functions?|methods?|members?|attributes?|fields?|properties)\s+(?:are|is)\s+(?:in|inside|within)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+(?:functions?|methods?|members?|attributes?|fields?|properties)\s+(?:does|do)\s+(.+?)\s+have\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+are\s+(?:the\s+)?(?:functions?|methods?|members?|attributes?|fields?|properties)\s+(?:of|in|inside|within)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^(?:the\s+)?(?:members?|methods?|attributes?|contents)\s+of\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+is\s+(?:in|inside)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+else\s+is\s+(?:in|inside)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+(?:defined|declared)\s+(?:the\s+)?(?:function\s+|method\s+|class\s+|module\s+|variable\s+|constant\s+)?(.+?)\??$/i,to:e=>`where is ${e[1]} defined`},{re:/^where'?s\s+(?:the\s+)?(.+?)\s+(defined|declared|located|implemented)\??$/i,to:e=>`where is ${e[1]} ${e[2]}`},{re:/^were\s+is\s+(?:the\s+)?(.+?)\s+(defined|declared|located|implemented)\??$/i,to:e=>`where is ${e[1]} ${e[2]}`},{re:/^what\s+is\s+the\s+purpose\s+of\s+(?:the\s+)?(?!(?:an?|it|this|that|these|those)\s)(.+?)\??$/i,to:e=>`what is a ${e[1]}`},{re:new RegExp(`^what\\s+does\\s+(?:the\\s+)?(?!(?:an?|it|this|that|these|those)\\s)(.+?)\\s+do\\s+(?:${au.map(ot).join("|")})\\??$`,"i"),to:e=>`what is a ${e[1]}`},{re:/^(?:which|what)\s+(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+(?:are|is)\s+(public|private|protected|static|abstract|constant|exported|re-?exported|tested|covered|untested|uncovered)\??$/i,to:e=>`${e[2].toLowerCase()} ${e[1].toLowerCase()}`},{re:/^what\s+(?:is|are)\s+(not\s+)?(tested|untested|covered|uncovered)\??$/i,to:e=>{let t=e[2].toLowerCase();return`${e[1]?t==="tested"?"untested":t==="covered"?"uncovered":t:t} modules`}},{re:/^what\s+does\s+(.+?)\s+changes?\s+together\s+with\??$/i,to:e=>`what co-changes with ${e[1]}`},{re:/^what\s+changes?\s+together\s+with\s+(.+?)\??$/i,to:e=>`what co-changes with ${e[1]}`},{re:/^how\s+many\s+commits\s+(?:are|were)\s+(?:recorded|logged)\s+(?:for|against)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`how many commits touched ${e[1]}`},{re:/^who\s+(?:wrote|authored)\s+(?:the\s+)?(?!(?:commit\s+)?[0-9a-f]{7,40}\??$)(.+?)\??$/i,to:e=>`who touched ${e[1]}`},{re:/^who\s+is\s+the\s+authors?\s+of\s+(?:the\s+)?(?!(?:commit\s+)?[0-9a-f]{7,40}\??$)(.+?)\??$/i,to:e=>`who touched ${e[1]}`},{re:/^(?:does|do)\s+(?!.*\bnot\b)(.+?)\s+have\s+(?:any\s+)?(?:tests?|test\s+coverage|coverage)\??$/i,to:e=>`what tests ${e[1]}`},{re:/^(?:is|are)\s+(?!.*\bnot\b)(.+?)\s+tested\??$/i,to:e=>`what tests ${e[1]}`},{re:/^what\s+needs\s+(?:to\s+be\s+)?(?:a\s+)?(?:tested|tests?|testing|coverage|covering)\??$/i,to:()=>"untested modules"},{re:/^(?:which|what|list|show(?:\s+me)?|find)?\s*(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+(?:(?:that|which)\s+)?(?:have|has|having|with)\s+no\s+tests?\??$/i,to:e=>`untested ${e[1].toLowerCase()}`},{re:/^(?:which|what|list|show(?:\s+me)?|find)?\s*(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+without\s+(?:any\s+)?tests?\??$/i,to:e=>`untested ${e[1].toLowerCase()}`},{re:new RegExp(`^(?:do|does)\\s+(.+?)\\s+(${Xk})\\s+(?:anything|something)(?:\\s+else)?\\??$`,"i"),to:e=>`what does ${e[1]} ${e[2]}`}]);zR=new RegExp("^(?:which|what|who|list|show(?:\\s+me)?|find|give\\s+me)?\\s*(?:the\\s+|all\\s+)?([a-z][a-z-]*)\\s+(?:(?:that|which|who)\\s+)?(?:(?:do|does|did|are|is|was|were|have|has|can|could|will|would|should)\\s+not|cannot|can't|won't|couldn't|shouldn't|wouldn't|not)\\s+(.+)$","i");dt=new Set(["what","who","which","where","when","why","how","does","do","did","is","are","was","were","the","a","an","of","to","from","at","in","on","there","something","anything","nothing","one","any","anywhere","last","usually","typically","generally","normally","often","commonly","mostly","should","would","could","can","will","shall","might","must"]),nn=e=>String(e).replace(/\?+\s*$/,"").replace(/,/g," ").split(/\s+/).filter(Boolean),ge=e=>e.flatMap(t=>String(t).toLowerCase().split(" "))});var Ig,Cg=M(()=>{Ig={source:"corpus/wordnet/*.jsonl lemmas, expanded through the regular -s/-ed/-ing inflections",generator:"scripts/generate-real-word-collisions.mjs",targets:["alongside","build","builds","built","call","calling","calls","change","changed","changes","check","checks","class","co-change","co-changes","code","commits","contain","containing","contains","couple","couples","cover","covers","declare","declares","define","defined","defines","defining","denote","denotes","denoting","depends","derive","derives","directly","edited","execute","executes","exercise","exercises","explicitly","export","exporting","exports","expose","exposes","extend","extending","extends","fire","fires","from","grab","grabs","have","hits","hold","holds","hooked","import","importing","imports","included","indirectly","inherit","inheriting","inherits","inside","into","invoke","invokes","kick","kicks","kind","land","landed","lean","leans","live","lives","make","makes","modified","modifies","move","moves","parent","part","pass","passes","pull","pulls","re-export","re-exports","reference","references","relies","rely","require","requires","runs","serve","serves","serving","share","shares","sits","subclass","subclasses","subclassing","superclass","superclasses","sure","talk","talks","tend","tends","test","testing","tests","through","together","touch","touched","touches","touching","transitively","trigger","triggers","tweaked","updated","uses","using","usually","verifies","verify","went","were","wired","with"],words:["aalging","aasing","aave","ablies","abling","aboves","absing","abuses","abusing","acauling","achinged","acolds","acquire","acquires","acyling","adelies","adenine","adenined","adenines","adenining","adenota","adenotaing","adenotas","aditted","aerides","aerified","aerifies","aerify","aerying","affine","affined","affines","affining","afire","afires","afling","agalling","ailing","aired","airied","airies","airport","airporting","airports","airsed","airses","airted","alaing","alases","albing","alecks","aleves","aliaes","alikes","alines","alive","alives","allaing","allies","alling","alls","allying","alongsided","alongsides","alping","alting","altogether","amasses","amazes","amends","amorting","amorts","amuses","amusing","analling","anded","anoded","ansing","anuses","apart","aparts","apises","apparent","appends","appose","apposes","apsing","apsises","arab","arabis","arabs","ardent","argent","arpent","arrive","arrives","arsing","asaing","asding","aseans","ases","ashing","ashore","ashores","asing","asking","asping","asring","asses","assess","assets","assing","assure","attending","attest","attesting","attests","audited","aufing","auging","auking","aurifies","aurify","avouch","avouched","avouches","avouching","awaked","awakes","awared","awares","awling","awried","axling","baases","badded","bailed","bailing","baited","bake","bakeds","bakers","bakes","balded","balding","baling","balk","balking","balks","ball","balling","balls","ballsing","ballying","balming","band","banded","bandeds","bandied","bandsed","banked","banned","barded","barelies","barely","barses","bart","baseses","bashes","basing","basises","bass","bassed","basses","basset","bassets","bassos","bastes","basting","batses","bauded","baulks","bawded","bawling","bbsing","beaked","bean","beanos","beans","beasting","beasts","beating","beeting","begild","begilds","behave","behold","beholds","belied","belief","beliefs","belies","belikes","belizes","belles","bellies","belling","belting","bend","bended","bends","bent","berging","bering","berking","berming","beroes","besets","besots","besses","bessing","best","besting","bests","beting","betting","bevies","bhanged","biered","bigger","biggers","billing","bind","binded","birded","birled","birles","biroed","birred","bising","bjsing","bladed","blanced","bland","blanda","blandaed","blanded","blands","blanked","blares","blases","blasts","bleaked","bleaks","blears","bleats","blended","blends","blesting","blests","blinded","blinds","blited","blites","bloked","blonded","bmuses","bnsing","boched","boches","boching","bocked","bode","bodilied","bodilies","boiled","boileds","bokked","bold","bolds","bolling","bonded","boners","bonked","boobed","booked","bookeds","bookend","booker","bookied","booksed","boomed","booned","boored","booted","boozed","borers","borough","bosked","bosses","botched","botches","botching","boucheed","bouchees","boucle","boucled","boucling","boughed","boughing","boules","boulle","boulles","bouses","bousing","bowers","boxers","bpsing","bragger","braggers","brakes","branded","brasses","breaked","breves","breving","bricks","brigged","brills","broked","brooked","bruins","brunts","brunus","bses","bsing","bugled","bugles","buhled","builders","buildups","bull","bulled","bullet","bulling","bulls","buns","bunses","bunsing","buried","burieds","burled","burleds","buses","bushes","bushing","busied","busies","busking","bussing","busying","buyied","buying","bypass","bypasses","caballing","cabals","cabbing","cabers","cabged","cabging","cables","cablin","cabling","cablins","caching","cackling","cadded","cadding","cadent","cadged","cadges","cadging","cadring","cafers","caffing","cafing","cagers","caging","cagying","caining","cajoling","cake","cakes","cakiling","caking","calcine","calean","caleans","caleying","caleys","calf","calfing","calfs","califs","calkin","calking","calkins","callaing","callas","callers","callinged","callings","callous","callowing","callows","calluna","callus","calm","calming","calmings","calmlying","calms","calquing","calvaing","calvas","calves","calving","calvings","calx","calxes","calxing","calycling","calyxing","camass","camelling","camels","camming","camoing","camping","canaing","canalling","canals","candid","candied","candled","candling","cangue","cangued","cangues","caning","canning","canoes","canting","cantling","capers","caping","caplin","caplins","capoing","capping","captain","captaining","captains","carded","carding","caring","carking","carlina","carline","carling","carlings","carlos","carning","caroling","carolling","carols","carping","carring","cart","carting","carver","carvers","carves","casaing","cashes","cashing","casking","cassies","castes","castling","casually","casuses","caters","catling","catlings","catses","catsing","catting","cattling","caul","cauline","cauling","caulking","cauls","cavaing","cave","caverns","cavilling","cavils","caving","cavying","cawing","caying","ceases","cecalling","cede","cedied","ceiling","cell","celling","celloing","cellos","cells","cellsing","cent","cercises","cere","cering","cerise","cerises","ceroing","cerring","certain","certaining","certains","certifies","certify","cervina","cervus","cfling","cgsing","chadded","chafed","chaffed","chafinged","chagaed","chagas","chagga","chaggaed","chaggas","chained","chainsed","chainses","chaired","chaise","chaised","chaises","chaited","chaits","chajaed","chalked","chalking","challis","champed","chanal","chanals","chanar","chanars","chance","chanced","chancels","chances","chancied","chancies","chancre","chancred","chancres","chancy","changers","channels","chanted","chanters","chanteys","chantied","chanties","chanty","chaosed","chaoses","chappe","chapped","chappes","charded","chards","charge","charged","chargers","charges","charied","charmed","charms","charred","charrs","charted","charts","chased","chasmed","chasms","chassed","chaste","chasted","chastes","chatted","chaunaed","chaused","chauses","chawed","cheaps","cheats","checkeds","checkers","checksum","checkups","cheek","cheeks","cheeps","chelas","chenned","cheops","cherts","chesting","chewas","chianed","chick","chicks","chigger","chiggers","chiling","chilling","chills","chinaed","chined","chines","chinked","chinks","chinned","chinoed","chirks","chits","chives","choanaed","chock","chocked","chocks","choked","choker","chokers","choler","cholers","chonned","choosed","chords","chores","chough","chuaned","chuck","chucks","chugged","chunga","chungaed","chungas","chunked","chunks","chyling","cialis","cicers","ciders","circed","circes","cive","cives","civies","cladded","claded","clades","clading","clads","claims","clamps","clams","clamses","clanged","clangers","clanks","clans","claps","clarks","claros","clash","clashes","clasp","clasps","classed","classic","classy","clast","clasts","clausa","clausas","clause","clauses","claver","clavers","clavus","clawing","claws","claying","clays","clean","cleans","cleanse","clerks","clever","clevers","cliing","climes","clinged","cloaks","clocks","closer","closers","closes","cloved","cloven","clovens","clover","clovers","clucks","cluing","clving","clxing","cnsing","coached","coaches","coaching","coaling","coasts","coaxer","coaxers","cobber","cobbers","cobble","cobbles","cocain","cocaining","cocains","cocked","cocker","cockers","cockle","cockles","coda","codaed","codded","coddles","coded","coders","codes","codex","codgers","codified","codifies","codling","cods","coed","coeurs","coffer","coffers","coggle","coggles","coheres","coiling","coiner","coiners","coired","coke","colaing","cold","colded","colding","colds","cole","coleus","coliing","coling","colling","collins","collying","colors","coltan","coltanning","coltans","colter","colters","colting","comalling","combats","comber","combers","come","comer","comers","comfies","comfit","comfits","comics","comints","comity","commas","comments","commes","commie","commied","commies","comming","commit","commix","commixes","commons","commute","commutes","compel","compels","compile","compiles","complies","comply","comport","comporting","comports","conched","conches","conching","concluded","cone","coneys","confer","confers","confining","confits","conged","conger","congers","conges","conjoin","conjoining","conjoins","conked","conker","conkers","constrain","constraining","constrains","contact","contacting","contacts","contadinoing","contadinos","contagion","contagioning","contagions","containeds","containers","contemn","contemning","contemns","continuing","contrail","contrailing","contrails","contriting","contriving","converse","converso","converts","convex","convey","conveys","convoke","convokes","cooked","cookeds","cookers","cookied","cooled","cooler","coolers","cooling","cooned","cooped","cooper","coopers","cooted","cooter","cooters","copalling","cope","copeck","copecks","copier","copiers","copies","copper","coppers","copses","copula","copulas","coralling","corded","core","coreference","coreferences","corer","corers","corked","corker","corkers","corner","corners","corpse","corpses","corvee","corvees","cosecs","cosher","coshers","cosmics","cosmids","cosses","costing","cotanning","cotans","cote","cotter","cotters","couch","couched","couches","couching","coude","couded","coue","coughed","coughing","coupe","coupes","coupleds","couplers","couplets","coupon","coupons","course","courses","couthed","couthing","coved","coven","covens","covereds","coverts","covet","covets","covey","coveys","cower","cowers","cowling","cowpie","cowpies","cozens","cpsing","crab","crabs","cracks","cradling","cragged","crakes","craned","cranes","cranked","cranned","crass","crasses","crawling","crawls","creaked","creaks","credited","creeks","cresting","crests","criers","cringe","cringed","cringes","crocks","crooked","crouch","crouched","crouches","crouching","croupe","croupes","crumple","crumples","cruses","crusing","cses","csing","ctened","ctenes","cubing","cuking","culling","culming","culting","cupalling","cupels","cupsing","cupule","cupules","cure","curing","curling","curses","cursing","curtain","curtaining","curtains","curves","curving","cusking","cusping","cussing","cuting","cutlass","cutses","cutsing","cxling","cxlving","cyanned","cyanoed","cycling","cyders","cymling","cysting","dadded","dahling","dailing","daises","daling","dall","dalliing","dalling","dallis","dalls","dallying","daloing","danced","dander","dandied","dandled","danked","dansed","danses","darded","darling","dart","dashes","dassed","dassies","dative","datives","dayses","ddsing","deafened","deafening","deafing","deaing","dealting","dean","deaned","deaning","deans","dearie","dearies","debate","debates","debating","debiled","debiling","deboned","debrises","debted","decade","decades","decalling","decease","deceases","deceive","deceives","decents","decided","deciding","deciled","deciling","declaim","declaims","declareds","declarers","declaw","declined","declining","decocting","decodes","decoding","decoing","decoke","decokes","decoking","decouple","decouples","decoying","decries","deepens","deface","defaced","defaces","defacing","defame","defamed","defames","defaming","defang","defanged","defanging","defangs","defence","defenced","defences","defencing","defended","defending","defends","defensed","defenses","defensing","deference","deferences","deferenses","defiance","defianced","defiances","defiancing","defiant","defianted","defianting","defiants","defied","defies","defile","defiled","defilers","defiles","defiling","defininged","definings","definited","definites","definiting","deflate","deflates","deftness","defuse","defused","defuses","defusing","deglaze","deglazes","deicing","deified","deifying","deigned","deigning","deisted","deists","deitied","delete","deletes","deleting","delfing","delfting","deliing","delivers","delling","delving","demands","demised","demising","demode","demodes","demoding","demoing","demote","demotes","demoting","dengue","dengues","denguing","denied","denned","denotives","denotiving","densaing","denses","densing","dent","dentate","dentates","dentating","dente","denteds","dentes","dentin","dentined","dentines","denting","dentining","dentins","denude","denudes","denuding","denying","depart","depend","depended","deplane","deplanes","deplore","deplores","deponed","deposing","depotting","deprave","depraves","deprive","depriveds","deprives","depute","deputes","deputing","derating","derbies","deride","derides","deriding","derisive","derisives","deriveds","dermises","derpies","derping","derring","derrises","derving","descends","deserve","deserves","deserving","designed","designing","desired","desiring","desking","desponds","dessing","destined","destines","destining","destiny","detained","detaining","detents","detest","detesting","detests","detinue","detinued","detinues","detinuing","detoxes","detoxing","deuses","deusing","deveined","deveining","deviced","devicing","deviled","devised","devising","devote","devoteds","devotees","devotes","devoting","devouting","dewied","dewiness","dewing","dexoned","dhalling","dholed","dholes","dick","dicks","dieted","digger","diggers","dilling","dining","dinted","dinting","dire","direct","directed","director","directory","directs","dired","dires","dirged","dirges","dirked","disport","disporting","disports","disses","ditaed","ditted","dive","dives","divest","divine","divined","divines","divining","dmuses","docked","doleds","dolling","domine","domined","domines","domining","donate","donates","donating","doobed","doomed","doored","dopeds","dories","dorked","dosing","dosses","doting","double","doubles","douched","douches","douching","doughed","doughing","douses","dousing","dove","doves","dowers","dozers","drab","drabas","drabs","dragger","draggers","drained","draining","drakes","dranged","drecks","drilies","drive","drivels","drivens","drivers","drives","drover","drovers","drunks","druses","drusing","drylies","dses","dsing","dsling","dtsing","ducing","duding","dudses","dudsing","duking","dulies","dull","dulling","dulls","dulses","dulsing","duning","duns","duoing","duping","duples","during","dusking","eagling","earling","earses","easies","easing","easted","easting","eating","eatses","ebitted","ebooked","ebsing","ebving","echted","eclats","ecting","eddaed","eddied","eddoed","edgied","edibled","edicted","editeds","editor","editted","edsing","edtaed","educed","eduled","eelses","eerilies","eerily","eerying","effort","efforting","efforts","efting","egesting","egests","eidoses","eiraed","elan","eland","elanded","elanned","elans","elanus","elated","elegans","elided","elinted","elited","elling","elocute","elocutes","elopses","elsing","eluted","elvers","emending","emiled","emitted","emoted","emoting","emsing","enated","enates","enating","encode","endived","ends","energise","energises","enquire","enquires","ensile","ensure","entendring","ententing","epopses","eposes","equally","equine","equines","eraing","erectly","erging","erning","eroses","erring","ersted","ersting","erudited","erying","escort","escorting","escorts","eses","esing","esports","esportsing","espouse","espouses","esquire","esquires","esting","ests","eternise","eternises","ethoses","evicted","evoked","evokes","exceed","exceeding","exceeds","exchange","exchanged","exchanges","excite","excited","excites","excluded","execrate","execrates","executeds","executive","executives","executors","exegete","exegetes","exercisers","exerciseses","exerting","exerts","exhort","exhorting","exhorts","exiled","existed","exitted","exodes","exorcise","exorcisers","exorcises","exorcism","exorcisms","exorcist","exorcists","exorcize","exorcizes","expand","expanding","expands","expanse","expanses","expats","expatting","expect","expecting","expects","expend","expending","expendings","expends","expense","expenses","expensing","expert","experting","expertise","expertises","experts","expiating","expiring","expiry","expirying","explicit","explicits","explode","explodes","exploit","exploiting","exploits","exploring","expoing","exporters","exportinged","exportings","expos","exposeds","exposing","exposure","exposures","express","exsert","exserting","exserts","extant","extanting","extants","extendeds","extent","extented","extenting","extents","extern","externa","externaing","externas","externed","externing","externus","extort","extorting","extorts","extruding","fabling","fadded","failing","failling","faire","faires","fairies","faited","fake","fakers","fakes","fall","falling","fallings","falls","fallsing","falses","falsing","fanned","farces","fare","fares","fart","fasces","fassed","fasting","fawkes","fcsing","feasting","feasts","feating","fecalling","feeting","feined","feining","feisting","feists","felids","feline","felined","felining","felises","fellies","felling","felting","fend","fended","fends","feres","ferined","fering","ferining","ferning","ferring","fesses","fessing","feting","fetting","fevers","fibers","fibre","fibres","fice","fices","fide","fides","fiends","fierce","fierces","fieries","fieris","fife","fifes","figure","figures","file","filers","files","filets","filles","filling","filses","find","finded","fine","finers","fines","fining","fiords","fireds","firm","firmas","firmers","firms","firmus","firsts","firths","fishes","fisting","fitses","fixe","fixeds","fixers","fixes","fizzes","flakes","flange","flanges","flanked","flanned","flasks","flecks","flicks","fliers","flirts","focalling","fold","folds","folies","folked","fonded","fooded","fooled","footed","forces","fore","fores","forest","forges","forked","form","fortes","fosses","fountain","fountaining","fountains","foyers","fpsing","freaked","frieds","friers","fries","frigged","frog","froms","frores","fros","frsing","fsbing","fshing","full","fulling","fulls","fuming","funded","funs","furies","furzes","fuseds","fusees","fusels","fuses","fusing","fussing","fuzing","fwsing","gabling","gabs","gadded","gaeling","gaited","galaing","galing","gall","galliing","gallina","galling","gallings","gallis","galls","gallus","gand","ganded","gander","gandied","ganked","gaoling","garb","garbs","garded","garment","garnet","gaseses","gashes","gassed","gassies","gatling","gauched","gauches","gauching","gauded","gauling","gausses","gcsing","gean","geans","gelids","gellies","gelling","gelting","genies","genome","genomes","genoming","gent","germing","gerres","gestaing","gestes","gesting","getting","gilling","girded","girled","giroed","gisting","give","givens","gives","gladded","gladed","glanced","gland","glanded","glands","glandsed","glansed","glares","glass","glasses","glassy","gleams","glean","gleans","glides","glises","gofers","gold","golds","gonded","goners","gooded","goofed","gooked","gooned","gooped","goosed","gorals","gouached","gouaches","gouaching","governs","gpsing","graces","grad","grades","grads","graf","grafs","grafts","grails","grains","gram","gramas","gramps","grams","gran","granded","grands","grange","granged","granges","grans","grants","grapes","graphs","grases","grasps","grass","grasses","grassy","gratas","grates","gratis","graves","gravis","gray","grays","grazes","greats","grebes","greylies","greyly","groaks","groans","groats","grouch","grouched","grouches","grouching","groves","grub","grubs","grunts","gruses","gsaing","gsring","guesting","guests","guiing","guild","guilds","guiled","guiles","guilt","guilty","guises","guising","gull","gulling","gulls","guns","guses","gushes","gushing","gussing","gutses","gutsing","guying","gyrans","habits","hacked","hadded","hagged","haicks","haiked","hailing","haired","haje","hakeas","hakes","halals","hale","halfing","haling","hall","halling","halls","halming","haloing","halting","halve","halved","halves","halving","hame","hand","handed","handeds","handel","hander","handied","handled","handsed","hanged","hangers","harded","harems","hares","harked","harold","harolds","hart","harvey","hashes","hassles","hastes","hasting","hate","hats","hauling","haved","haven","havens","haves","hawked","hawses","haze","heating","heave","heaved","heaven","heaver","heaving","hectare","hectares","hefting","heired","heisting","held","helds","helixes","helling","helving","herbes","herbing","herding","here","hering","herming","heroing","herpes","herring","hets","hetting","hexine","hexined","hexines","hexining","hexose","hexoses","hhsing","hiatus","hick","hicked","hicks","hies","hilling","hilts","hind","hinded","hinged","hinges","hins","hints","hips","hire","hired","hirers","hires","hirtas","hiss","hisses","hives","hivs","hoards","hoared","hoaxed","hobbed","hoboed","hocced","hocked","hockey","hodded","hods","hoed","hogged","hoists","hokaed","holcus","holders","holdups","hole","holed","holes","holeys","holism","hollas","hollos","holm","holms","holy","homers","homied","homoed","honied","honked","honker","honkey","honkied","honored","hooches","hooching","hood","hooded","hoodeds","hoods","hooeyed","hoofed","hoofeds","hoofer","hookah","hookeds","hooker","hookeri","hookers","hookied","hookies","hooksed","hookses","hookup","hooped","hoopoed","hoopsed","hooted","hooter","hooved","hooveds","hoovers","hopers","hopied","hopped","hopple","hopples","hopsed","horded","hordes","horned","horsed","hosing","hosted","hosting","hotbed","hots","hotsed","hotted","hounds","houred","housed","houses","housing","hover","hovers","hoyaed","hrts","hses","hsing","hucked","huging","hulked","hull","hulling","hullos","hulls","hunged","hunked","huns","huoned","hushes","hushing","husked","husking","husoing","huts","hyoids","ictalling","idioted","idlies","iising","ileals","illing","images","impact","impacting","impacts","impart","imparting","impartings","imparts","impasses","impends","implore","implores","imploring","impoliting","important","importeds","importeeing","importees","importers","importinged","importings","importune","importuning","imposing","impost","imposting","imposts","improving","impure","impures","impuring","imputing","inbuilt","incise","incite","inclined","inclosed","include","includeds","includes","income","incomes","indied","indirect","indirected","indirects","indite","indited","indole","indoles","inerting","inerts","inference","inferences","infidel","influxed","info","inhabit","inhabits","inhere","inhered","inherent","inherenting","inherents","inheriteds","inheritinged","inheritings","inheritors","inheritting","inhibit","inhibits","initio","inkied","inland","inlanded","inline","inosine","inquire","inquires","insane","insert","inserting","inserts","insided","insider","insiders","insides","insist","insoles","inspire","insted","insting","intake","intakes","intending","interim","interims","intermit","intermits","inti","intied","intoed","intones","intos","intro","intron","intros","intruded","invades","invert","inverting","inverts","invites","invoice","invoices","involve","involves","iodide","ipsing","ired","ires","ironside","irsing","iruses","ises","isiing","ising","island","islanded","isling","isming","isning","isring","itsing","iuding","jailing","jakes","janned","jawses","jean","jeans","jellies","jelling","jerking","jest","jesting","jestings","jests","jetting","jigger","jiggers","jirded","jive","jives","jocked","jokers","jooked","josing","josses","joules","jove","joves","juking","julies","juning","jure","juring","juses","jussing","justes","juting","kailing","kakkes","kalaing","kaliing","kaling","kalkas","karens","karling","kelpies","kelting","kenoing","kepting","keraing","kerbing","kerite","kerited","kerites","kerning","kerring","keynote","keynotes","keynoting","khanned","kianged","kickers","kied","killing","kilned","kina","kinaed","kinda","kindas","kindle","kindly","kinds","kine","kined","king","kinged","kinked","kinks","kinned","kino","kinoed","kins","kiosks","kirk","kirked","kirks","kisses","kith","kleins","klick","klicks","knacks","knocks","knucks","koined","kooked","kookied","kuiing","kvasses","kweeked","kylies","labbed","lacced","lacied","lacked","ladded","ladder","laddied","laded","ladied","ladled","ladling","laed","lagans","lagend","lagended","lagged","lahhed","lahued","laiced","laid","laided","lairded","lake","lakes","lakhed","lallying","lamaed","lambed","lament","lammed","lamnaed","lamped","lanaied","lanated","lanced","lancer","lances","lancet","landaued","landeds","lander","landers","landler","lands","lane","lang","langed","langued","lank","lankaed","lanked","lankied","lanned","lansaed","lanseh","lanset","lapped","lapsed","lapses","lard","larded","larder","larged","laried","larked","larred","lashed","lashes","lassas","lasses","lassies","lassos","lasted","lasting","latent","latest","latesting","latests","lathed","latked","latkes","latsed","latses","latted","lauans","laud","lauded","lauder","laudes","launced","launder","lavaed","laves","lavved","lawsed","lawses","laxaed","lazied","lead","leaded","leaden","leadens","leads","leaf","leafs","leak","leaked","leaks","leal","leals","leaners","leap","leaps","learn","learns","leases","leasting","leaven","leavens","leaving","ledded","lefting","legals","legends","lemnas","lemons","lended","lender","lends","lenifies","lenify","lens","lensed","lent","lented","lentes","lentoing","leon","leones","leons","lerring","lesses","lessing","letting","levants","levees","levels","levited","levving","lewded","lianaed","lianas","liared","libels","libred","lice","lices","lick","licks","lidded","lieded","lieges","lies","life","lifers","lifes","ligand","liganded","ligans","ligers","lignes","like","likeds","likens","likes","limans","lime","limens","limes","limeys","linden","lindied","line","lineds","linens","liners","lines","linged","linied","linked","linoed","linted","liraed","lirred","lises","lisles","listes","listing","lite","liters","lites","lithes","litred","livedos","livens","livers","livias","livids","llanoed","llanos","loached","loaches","loaching","loaded","loan","loans","localling","loched","loches","loching","locked","lode","lohans","loired","lolling","loners","longed","looked","looker","looksed","loomed","looned","looped","loosed","looted","lorded","losers","losing","losses","losting","louched","louches","louching","louded","loughed","loughing","loupes","louses","lousing","louver","louvers","lover","lovers","lowans","lowers","lsding","lubing","lueses","luesing","luging","lull","lulling","lulls","lunaed","lundaed","lunged","lunned","luoing","lure","luring","lushes","lushing","luting","luxing","lynxed","mace","macers","maces","maches","mackems","mackle","mackles","madake","madakes","madded","made","mades","maes","magens","mahoes","maided","mailing","maines","maired","maizes","makers","makeups","mako","makos","male","maleos","males","maliing","maliks","maling","mall","malling","malls","malsing","malting","mameys","mandaed","manded","mane","maneds","manes","manied","manies","mankies","manned","mansed","manxed","manxes","maples","mapling","mare","mares","marges","maries","markeds","markers","markets","marling","mart","martes","masers","mases","maskeds","maskers","mass","massed","masseds","masses","masting","mate","mateds","maters","mates","mateys","mattes","mauling","maunded","maxes","maybes","maze","mazeds","mazers","mazes","mazies","mealies","mean","means","meating","mediaed","mediated","medicied","meeting","meined","meining","melees","melias","melics","melting","mend","mended","mends","menoing","mere","merelies","merely","merges","merging","mering","merited","merles","merling","merring","merses","mersing","mesaing","meshing","mesning","messes","messing","meting","metrifies","metrify","mevving","mick","micks","mike","mikes","milling","mind","minded","minified","minifies","minkes","mire","mired","mires","miried","miries","miroed","mising","misses","misting","mitred","mitres","mlsing","mocked","models","modems","modes","modest","modifieded","modifiered","modifiers","modished","modishes","modisted","modistes","modses","mogens","mohaves","mohses","moired","mojave","mojaves","mold","molds","mole","moles","molest","molles","mollified","mollifies","molling","molvas","mommies","monded","mondes","monels","moneys","monked","monses","montan","montanning","montans","montes","mooched","mooches","mooching","mooded","mooned","moored","moosed","mooses","mooted","mope","mopeds","mopes","more","morels","mores","morses","mortified","mortifies","moses","moseys","moshes","mosting","mote","motels","motes","motets","motiffed","motive","motives","moue","moues","moulds","mountain","mountaining","mountains","mousing","mouthed","mouthing","moveds","movie","movies","moxies","mpsing","mrsing","msbing","mscing","mses","msging","mshing","msing","muanged","muched","muches","muching","muling","mull","mullas","mulling","mulls","mullus","muming","musaing","musding","musers","muses","mushes","mushing","musing","musings","musking","mussing","muting","mutually","myalling","myalls","myopes","nadded","nailing","naives","nakeds","nalline","nanaed","nanced","nand","nanded","nandued","nanned","narded","nashes","nasuses","nauched","nauches","nauching","nave","neating","nemine","nemined","nemines","nemining","nerding","nerve","nerves","nerving","nervus","nervying","nesses","nessing","nest","nesting","nestings","nestling","nests","netting","nevers","neving","newlies","newting","nexted","nexting","nick","nicks","nigger","niggers","nilling","nisied","nisting","nitred","nitres","niveas","nivose","nivoses","nocked","node","noired","noires","nolling","nonuple","nonuples","nooked","nookied","nooksed","nooned","noosed","nosing","notched","notches","notching","notified","notifies","noting","nouses","nousing","nsaing","nscing","nsfing","nsuing","nswing","nuding","nuited","nuking","null","nulling","nulls","nuns","nurses","nursing","nutses","nutsing","nuxing","oakens","oasing","oasises","oasting","oatses","observe","observes","observing","obtain","obtaining","obtains","occluded","oceans","ochers","octalling","octuple","octuples","odisted","ogives","oilies","oising","olds","olefine","olefined","olefines","olefining","oleins","olive","olives","onlies","onto","onuses","opalling","opiated","oppose","opposes","opulus","opuses","oralling","orange","oranged","oranges","oses","osing","otuses","ouring","ousels","outclass","outclasses","outclassing","outdated","outing","outrigger","outriggers","ovalling","over","overs","overts","pacoses","pacs","pact","padded","padres","pads","paduses","paeans","pageant","pageses","paided","pailing","painses","paired","paks","palases","paliing","paling","palling","pallying","palming","palmses","paloing","pals","palsies","pandaed","pander","pangses","panned","pans","pansies","pant","panted","pantses","paps","para","parang","pare","parental","parented","parents","parers","pareve","pari","paries","paring","parises","parity","park","parr","parsec","parsecs","parsed","parsee","parsees","parser","parsers","parses","parted","parti","partis","partly","parts","partses","party","paruses","parvenu","parving","pasches","paso","pasoed","pasos","pasques","passages","passed","passeds","passee","passeed","passees","passel","passels","passer","passers","passims","passives","passkey","passkeys","passu","passued","passus","pasted","pasteds","pastel","pastels","paster","pasters","pastes","pasties","pasting","pastises","pasts","patases","patens","patent","patents","patient","pats","patsies","pauling","paulis","paused","pauses","pausing","pave","pavises","pawling","paws","payees","payment","pays","pbsing","peaked","pean","peans","peated","peating","pecans","pecses","peeves","peeving","pekans","pelling","pelting","pent","percent","perces","percing","pere","periing","pering","perking","perming","perring","pert","peruing","perve","perves","perving","pesoing","pessed","pessing","pest","pesting","pestis","pestling","pestoing","pestos","pests","petited","petrifies","petrify","petting","peyote","peyotes","peyoting","phaged","pharos","pholis","phsing","pick","picks","piered","pigses","pill","pilling","pills","pinses","pinto","pintos","pisces","piss","pissed","pisseds","pisser","pissers","pisses","pistes","pisting","pith","pitses","plaided","planaed","planked","planned","planted","plashes","plated","pleads","pleats","plover","plovers","pmsing","poached","poaches","poaching","pocked","poises","pokers","polers","polies","poll","polling","pollos","polls","pommies","ponded","ponses","pooched","pooches","pooching","pooded","poofed","pooled","pooned","pooped","poored","pooved","pooves","porched","porches","porching","porked","port","portent","posers","poshes","posies","posing","posits","possed","posses","possess","posset","possets","postes","posting","potent","pouch","pouched","pouches","pouching","powers","praises","pranged","prat","prated","preference","preferences","prelims","premies","preses","presses","prexies","pricks","prigged","prises","prom","proses","proves","prunes","prunos","prunus","psaing","psas","pses","psiing","psing","pucing","puking","pula","pulas","pule","pules","puling","pullers","pullets","pulleys","pulling","pulp","pulps","pulsing","puns","pupals","pupated","pupils","pure","purelies","purely","purifies","purify","puring","purl","purls","pursing","puses","pushing","puss","pussed","pusses","pussies","pussing","pyrene","qianged","quaing","quakes","quares","quells","questing","quests","quicks","quiing","quilt","quired","quited","quoing","quolls","rabies","racies","radded","raided","railing","raises","rake","rakes","raling","rallies","rallying","ramies","ranaed","rand","randed","randied","raneed","ranges","ranied","ranked","ranted","rarelies","rarely","rarifies","rarify","rashes","rasing","rassed","rave","ravers","readies","realines","realise","realises","realizes","reallies","really","realties","realty","reaving","rebuild","rebuilds","reburies","recall","recalling","recalls","recces","reccies","recipes","recited","recites","reclines","recode","recommits","recover","recovers","redefine","redefined","redefines","redefining","redlines","reedies","reefies","reeving","referee","referees","referenceds","referent","refine","refined","refiners","refines","refining","refinings","refits","regias","regimes","regius","reined","reining","reited","reiting","rejigs","relaces","relates","relaxes","relay","relics","relict","relicts","relied","relief","reliefs","relieve","relieves","relievo","relievos","relines","relining","relish","relishes","relived","relives","remake","remakes","remise","remises","remiss","remits","remote","remotes","remoting","remove","removes","rend","rended","rends","renins","renises","rent","repands","repens","repents","repine","repined","repining","replay","replied","replies","reply","repose","reposes","requiems","requireds","requite","requites","requote","requotes","reruns","reserve","reserves","reserving","resets","reshes","reshing","reside","resides","resids","resiles","resins","resizes","respire","respires","ressing","rest","resting","restings","rests","retied","reties","reting","retire","retouch","retouched","retouches","retouching","retries","retting","reusing","reverence","reverences","revers","review","reviews","reviles","revise","revises","revive","revoke","revokes","revues","revving","rewire","rewired","rhuses","rick","ricks","rigged","riggeds","rigger","riggers","rilling","rimies","rind","rinded","ringer","ringers","ringside","rising","risses","rive","rives","rivets","roached","roaches","roaching","rocked","rogers","roilies","rolling","rons","rooded","roofed","rooked","rookied","roomed","rooted","ropers","ropies","rosies","rosing","rouble","roubles","roughed","roughing","rounds","rouses","rousing","rove","rover","rovers","roves","rowers","rubens","rubies","rubing","rubins","rubs","rudelies","rudely","ruding","rues","rugger","ruggers","rugs","ruins","rulied","rulies","ruling","ruly","rumens","rums","rune","runes","rung","rungs","runics","runing","runt","runts","runups","ruses","rushes","rushing","rusing","rusking","russing","ruts","saales","saaling","saames","sabling","sabres","sadded","saided","sailing","saints","saises","sake","sakes","salals","saling","salk","salking","salks","salling","sallying","salols","salping","salting","salves","sand","sanded","sander","sandied","sandsed","sanned","sansed","sanses","sapling","sarded","sarding","sariing","sarsing","sashes","sass","sassed","sasses","sassies","sats","saurel","save","savers","saving","scalding","scalds","scaling","scalping","scalps","scalying","scapes","scarce","scarces","scare","scareds","scarers","scares","scarfs","scaries","scarps","scends","schick","schicks","scired","scoked","scolds","scorer","scorers","scores","scoter","scoters","screes","scries","scruple","scruples","scrying","sculling","seaing","sealing","seaming","seaport","seaporting","seaports","seareds","searing","seasing","seaxing","sebaes","sebaing","sebbing","sebing","sebses","sebsing","seccing","secluded","secure","sedans","sedding","sedges","sedging","seeding","seeing","seeking","seeling","seeming","seening","seeping","seering","segoing","segues","seguing","seiding","seifing","seiing","seined","seiths","seizes","seizing","selfing","selvaing","selvas","semiing","semited","senate","senates","senating","send","sended","sending","sends","sening","senning","senses","sensing","sent","sepping","sequine","sequines","serape","serapes","seraping","seraxes","seraxing","serbing","serene","serenes","serening","serers","seres","serfing","serge","sergers","serges","serging","series","serined","sering","serous","serowing","serows","serpens","serums","servals","servant","servers","services","servicing","serviles","serviling","servinged","servings","servo","servoing","servos","setaing","sets","seuling","sevens","sewing","sewning","sexing","sexpot","sexpots","sexpotting","sexted","sexying","shabus","shade","shadeds","shades","shadies","shafts","shagged","shake","shakens","shakers","shakes","shakies","shakos","shale","shales","shame","shameds","shames","shamus","shanged","shanked","shanks","shanned","shape","shapeds","shapers","shapes","shard","shards","shareds","sharers","shareses","sharias","shark","sharks","sharons","sharp","sharpens","sharpers","sharpie","sharpies","sharps","shart","sharts","shaveds","shavens","shavers","shaves","shaving","shawls","shawms","sheareds","shearers","shearses","sheers","sheiks","shelve","shelves","shelving","sherding","sherds","shines","shinto","shire","shires","shirks","shirrs","shited","shnooked","shocked","shocks","shoeds","shooed","shooked","shooted","shore","shoreas","shores","shorns","shorts","shotes","shover","shovers","shoving","shreds","shrews","shriving","shrove","shroves","shroving","shucks","sibs","sick","sicks","sics","sids","sieving","sifts","sights","silling","silts","sind","sinded","sing","sins","sips","sirced","sircing","sired","sirens","sires","siring","sirred","sirring","sirs","sising","siss","sisses","sitars","site","sites","sitkas","sittas","situ","situs","sitz","sitzes","sixths","skates","skinks","skints","skirts","skits","skiving","skulls","slander","slanted","slates","slaving","sleeve","sleeves","sleeving","slices","slicks","slides","slimes","slits","slivers","slouch","slouched","slouches","slouching","slsing","smalling","smalls","smarms","smarts","smited","smites","smiths","smoked","snare","snarers","snares","snarfs","snarls","sneaked","snicks","snigger","sniggers","snits","snooked","snores","soaked","soaving","sobers","socked","solare","solares","sold","solds","solids","solling","solver","solvers","solving","sooned","sooted","sorbing","sore","sorelies","sorely","soring","sorting","sots","souchong","soughed","soughing","souked","soupies","source","soured","souses","sousing","southed","southing","sowers","spaces","spades","spalling","spanged","spare","sparers","spares","sparge","sparges","sparks","spasms","spated","spates","spazes","speaked","specks","spells","sperming","sphere","spheres","spicks","spills","spinto","spired","spirts","spited","spites","spits","splits","spoked","spooked","spores","sprees","spries","sprigger","spriggers","spring","sprits","sprues","spruing","sprying","spurge","squally","squares","squires","sriing","ssaing","sses","ssing","ssping","ssriing","sssing","sswing","stacks","stages","stalk","stalks","stalling","standed","stands","stanks","stapes","stare","starers","stares","starets","starses","starts","starving","states","staving","steads","steaked","steeds","stenting","sterling","sterning","stetting","sticks","stilts","stints","stoked","stores","stover","stovers","stoving","streaked","string","stringer","stringers","striving","suaving","subclassed","suched","suches","suching","sucre","sucred","sudated","sudses","sudsing","suer","suered","suering","sues","suiing","suing","suited","suites","suits","sullas","summits","sundated","sunglass","sunglasses","sunglassing","suns","superclassed","supergrass","supergrasses","sura","suraed","suraing","surd","surded","surding","sured","surelies","sures","surety","surf","surfed","surfer","surfing","surge","surged","surging","surrey","surveys","suses","sussing","suture","suvving","svring","swages","swales","swards","swarms","swarts","sweared","sweated","swerve","swerves","swerving","swervings","swifts","swined","swiped","swirled","switch","taaling","tables","tabling","tabses","tached","taches","taching","tack","tacks","tacting","tadded","taeling","tagger","taggers","tailing","tajiks","take","takens","takers","takes","tala","talaing","talas","talc","talcing","talcs","tale","talent","tales","taling","talkers","talkies","talking","talksed","talkses","talling","tallying","talons","talus","tandem","tank","tankas","tanked","tanks","tanned","taoses","tapses","tart","tarting","task","tasking","tasks","tassed","tassel","tassels","tasses","tasset","tassets","tassing","tasting","tastings","tastying","tatting","tauting","tawses","tdting","teached","teaches","teaching","teaing","teaked","teaking","tealed","tealing","teamed","teaming","teared","tearing","teased","teases","teasing","teasling","teat","teated","teating","teats","tebets","teccing","teched","teches","tectaing","tectas","tedding","teds","teed","teeing","teeming","teened","teening","teething","teeths","teffing","tegging","teiids","tejuing","tellies","temming","temping","tempting","tempts","tenched","tenches","tenching","tendeds","tenders","tendons","tenens","tenged","tenges","tenging","tenias","tenned","tenning","tennis","tennos","tenons","tenors","tensed","tenseds","tensing","tented","tenthing","tenting","tentings","tenuis","tepids","terces","tereting","terned","terrifies","terrify","teslaing","teslas","testaing","testas","testating","testeds","testeeing","testees","testers","testes","testied","testify","testily","testinged","testings","testis","testying","tether","tething","tetting","tevets","texans","text","texted","textes","texting","textings","texts","thaned","thanked","thanks","thanned","thecas","thefting","thefts","theist","theisting","theists","theres","thesis","thinged","tholed","tholes","thonged","thorough","thoroughs","thought","thrive","thrives","throng","throngs","throughed","throughs","thrush","thuses","ticalling","tick","ticks","tiered","tigers","tilling","tilting","tineds","tinting","tire","tired","tires","tiroed","titred","titres","titting","tnting","toasting","toasts","toeaed","toeses","toesing","togethers","told","tolds","tolling","tommies","tomtits","toneds","toners","tontining","tooled","tooned","tooted","toothed","toothing","tooting","topers","toposes","topple","topples","torch","torched","torches","torching","torting","toshed","toshes","tosked","tosking","tosses","tossing","toters","toting","totting","toucan","toucans","touchers","touchied","touchies","touchinged","touchingly","touchings","touchline","touchy","touchying","tough","toughed","toughens","toughied","toughies","toughing","toughying","touped","toupee","toupeed","touping","toured","touring","tousle","tousled","tousling","touted","towers","tracks","transitive","transitived","transitives","transitivity","treaded","treads","treated","treating","treats","treeds","trekked","trend","trends","trenting","tressing","trestling","triage","triaged","tricker","trickers","tricks","triers","trifler","triflers","trigged","trimer","trimers","trimmer","trimmers","tripper","trippers","trited","triting","troched","troches","troching","trough","troughed","troughing","troughs","troves","truced","truces","trucing","trucked","trucking","trudger","trudgers","trulies","trunks","trusting","trusts","truthed","truthing","trysting","trysts","tsetse","tsetsing","tubing","tucked","tucking","tufting","tugger","tuggers","tuling","tulles","tulling","tumses","tumsing","tuning","tuns","turing","tushed","tutting","tuxing","twanged","tweaks","tweeded","tweeds","tweeped","tweeted","tweeting","tweets","tweezed","twelved","twenty","twerked","twerped","twiced","twigged","twined","twirled","twirped","twisting","twists","twitch","ufoing","uglies","uhfing","uing","ukases","ukasing","ukes","uking","ulls","ulting","umaing","umping","unchanged","unclouded","uncouple","uncouples","uncover","uncovers","undated","undateds","undefined","unding","unedited","unhooked","uniated","uning","united","unkind","unlive","unlives","unmake","unmakes","unmated","unmodified","unqing","unsated","unsees","unsung","unsure","untouched","unusually","unwired","unyoke","unyokes","upbeated","upcasted","update","updates","updrafted","uphold","upholds","uping","upland","uplanded","upsets","upside","uptaked","upvoted","urated","urging","urling","urning","urns","ursine","uruses","usages","usaging","usaing","usas","usbegs","usbeks","uscbing","usdaed","usdaing","used","useds","user","userring","users","ushers","usinged","usings","usmcing","usneas","usning","usns","usps","uspses","uspsing","usss","usssing","usualed","usuals","usurer","utaing","utcing","utes","uting","utning","uubing","uuhing","uuping","uuqing","uuting","uving","uziing","valiing","valing","valling","valses","valsing","valuing","valving","vandaed","vanned","varment","vasing","vassed","vasting","vedisted","vegans","veined","veines","veining","vend","vended","vends","venose","venoses","venosing","vent","veraing","verbified","verbifies","verbify","verbing","verdes","verding","verges","verging","veridis","veridises","veried","verified","verifieds","verifier","verifiers","verited","veritied","verities","verity","verses","versified","versifier","versifiers","versifies","versify","versing","versting","versts","vertes","verve","verves","vervets","verving","verying","vest","vesting","vests","vetting","vianded","vilifies","vilify","vinifies","vinify","virens","vireos","vising","visits","visually","vitrifies","vitrify","vive","vives","vivifies","vivify","vivred","vocalling","vomers","vomits","voters","vouch","vouched","voucheed","vouchees","vouchers","vouches","vouching","vowers","wadded","wadses","waifed","wailed","wailing","wained","waived","waives","wake","wakens","wakers","wakes","waling","walk","walking","walks","wall","walling","wallings","walls","wallying","wand","wanded","wander","wanked","wanned","want","wanted","ware","wared","waried","warmed","warned","warped","warred","warsed","warses","wart","warted","washes","wassed","wastes","wasting","watses","wauling","wave","wavers","wawling","wayses","wbsing","weaked","weaken","wealed","wean","weaned","weans","wearer","weaved","weaves","weaving","weeked","weft","wefting","weirded","weired","wekaed","welling","welt","welting","wended","wends","wens","weres","wering","westing","wests","wetting","whacks","whales","whanged","wharfs","whelks","whiled","whined","whirled","whirred","whists","whites","whits","wholed","wholes","whooped","whored","whores","wick","wicked","wicks","wided","width","widths","wifed","wified","wigged","wilded","wiled","wilied","wilies","willed","willing","wilted","wimped","winced","wind","wined","winged","winied","winked","winned","winoed","wiped","wipeds","wireds","wirer","wiried","wised","wisent","wish","wished","wising","wisped","witch","withal","withe","wither","withes","within","withs","withy","witsed","witted","wive","wived","wives","wizzed","wlanned","wokked","wold","wolds","wonked","wont","wooded","wooers","woofed","wooled","worded","worlds","wormed","worned","worsed","worted","woulds","wove","woves","wraith","wrasses","wreaked","wrecks","wresting","wrests","wricks","wried","wriggler","wrigglers","wringer","wringers","writhe","wswing","wussing","wyrded","xerotes","xmases","yanaed","yanked","yarded","yawling","yawses","yearns","yeasting","yeasts","yelling","yerring","yessing","yetting","yolked","yorked","youthed","youthing","yuling","yuses","yussing","zaired","zaires","zanied","zend","zended","zends","zeroing","zest","zesting","zests","zestying","zeuses","zeusing","zhuanged","zilling","zonked","zoomed","zooted"]}});function Es(e,t,n){if(e===t)return 0;if(Math.abs(e.length-t.length)>n)return n+1;let s=null,o=Array.from({length:t.length+1},(r,i)=>i);for(let r=1;r<=e.length;r+=1){let i=[r],a=r;for(let c=1;c<=t.length;c+=1){let l=e[r-1]===t[c-1]?0:1,u=Math.min(o[c]+1,i[c-1]+1,o[c-1]+l);r>1&&c>1&&e[r-1]===t[c-2]&&e[r-2]===t[c-1]&&(u=Math.min(u,s[c-2]+l)),i[c]=u,u<a&&(a=u)}if(a>n)return n+1;s=o,o=i}return o[t.length]}function Ou(e){return/^[a-z]+$/.test(e)&&!dt.has(e)&&!Iu.has(e)}function Lg(e){return GR(e)?null:Ma(e,Ng,Ss(e))}function Ma(e,t,n=Ss(e)){let s=n+1,o=null,r=!1;for(let i of t){let a=Es(e,i,Math.min(s,n));a<s?(s=a,o=i,r=!1):a===s&&a<=n&&i!==o&&(r=!0)}return s<=n&&!r?o:null}var BR,Ss,Iu,Og,Ng,WR,GR,fr=M(()=>{Kn();Cg();Sn();BR=["used"];Ss=e=>e.length<=5?1:2,Iu=new Set([...Object.keys(me),...Object.keys(Qe),...Object.keys(mn),...BR].flatMap(e=>e.split(" "))),Og=4,Ng=[...new Set([...Object.keys(me),...Object.keys(mn)].flatMap(e=>e.split(" ")).filter(e=>e.length>=Og))],WR=new Set(Ig.words),GR=e=>WR.has(e)});function pr(e){for(let t of KR){let n=e.match(t.re);if(n){let s=t.build(n);if(s)return s}}return null}var Fa,VR,HR,qR,Nu,KR,Pg,Da=M(()=>{Kn();Sn();Fa=Object.keys(me).sort((e,t)=>t.length-e.length).map(ot).join("|"),VR=Object.keys(Qe).sort((e,t)=>t.length-e.length).map(ot).join("|"),HR=Object.keys(mn).sort((e,t)=>t.length-e.length).map(ot).join("|"),qR=wo.slice().sort((e,t)=>t.length-e.length).map(ot).join("|"),Nu=(e,t)=>e==="defines"&&Qr.has(t),KR=[{name:"ask",re:new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+(${Fa})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=me[t];return Nu(n,t)?null:Ws({shape:"ask",entityType:null,modifier:"direct",kind:n,subject:e[1].trim(),object:e[3].trim()},t)}},{name:"reverse",re:new RegExp(`^which\\s+(${VR})\\s+(?:(${HR})\\s+)?(${Fa})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[3].toLowerCase(),n=me[t];return Nu(n,t)?null:Ws({shape:"reverse",entityType:Qe[e[1].toLowerCase()],modifier:e[2]?mn[e[2].toLowerCase()]:"direct",kind:n,object:e[4].trim()},t)}},{name:"forward",re:new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+(${Fa})\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=me[t];return Nu(n,t)?null:Ws({shape:"forward",entityType:null,modifier:"direct",kind:n,object:e[1].trim()},t)}},{name:"meta-mean",re:new RegExp(`^what\\s+(?:does|do|is|are)\\s+(.+?)\\s+(?:${qR})\\??$`,"i"),build:e=>({shape:"meta",entityType:null,modifier:"direct",kind:"meta",object:e[1].trim()})},{name:"meta-whatis",re:new RegExp("^what\\s+(?:is|are)\\s+(?:(an?|the)\\s+)?(.+?)\\??$","i"),build:e=>{let t=e[1]?e[1].toLowerCase():null,n=pn(e[2].trim()),s=!/\s/.test(n);if(t==="the"&&!s||!t&&!Qe[n.toLowerCase()])return null;let o=n.toLowerCase();return t&&t!=="the"&&qm.some(r=>o===r||o.startsWith(`${r} `))?null:{shape:"meta",entityType:null,modifier:"direct",kind:"meta",object:Gs(n)}}},{name:"mention",re:new RegExp(`^where\\s+(?:is|are|was|were)\\s+(.+?)\\s+(?:${Ln.map(ot).join("|")})\\??$`,"i"),build:e=>({shape:"mentions",entityType:null,modifier:"direct",kind:"mentions",object:e[1].trim()})},{name:"where",re:new RegExp(`^where\\s+(?:is|are|was|were)\\s+(.+?)(?:\\s+(?:${fn.map(ot).join("|")}))?\\??$`,"i"),build:e=>({shape:"where",entityType:null,modifier:"direct",kind:"where",object:e[1].trim()})},{name:"when",re:new RegExp(`^when\\s+(?:did|does|do|was|were|is)\\s+(.+?)\\s+(?:last\\s+)?(${Fa})\\??$`,"i"),build:e=>me[e[2].toLowerCase()]==="touches"?{shape:"when",entityType:null,modifier:"direct",kind:"touches",object:e[1].trim()}:null},{name:"commit-history",re:/^(?:the\s+)?commit\s+history\s+(?:of|for)\s+(.+?)\??$/i,build:e=>({shape:"when",entityType:null,modifier:"direct",kind:"touches",object:e[1].trim()})},{name:"cochange-partners",re:/^co-?change\s+partners\s+(?:of|for|with)\s+(.+?)\??$/i,build:e=>({shape:"reverse",entityType:"Module",modifier:"direct",kind:"cochange",object:e[1].trim()})}];Pg={id:"grammar",class:"graph-query",run(e){let t=pr(e);return t?{strategyId:"grammar",class:"graph-query",candidates:[{parsed:t,confidence:.9}]}:null}}});function Mg(e){let t=e.trim().split(/\s+/);return t.length>1&&ba.has(t[0].toLowerCase())}function QR(e){return me[e.trim().toLowerCase()]==="calls"}function Pt(e,t,n=null){let s=Object.keys(t).sort((o,r)=>r.split(" ").length-o.split(" ").length);for(let o of s){let r=o.split(" ");for(let i=0;i<=e.length-r.length;i+=1)if(!(n&&r.some((a,c)=>n.has(i+c)))&&r.every((a,c)=>e[i+c]===a))return{kind:t[o],start:i,end:i+r.length}}return null}function ui(e,t=null){let n=e.replace(/\?+\s*$/,"").replace(/,/g," ").split(/\s+/).filter(Boolean),s=n.map(x=>x.toLowerCase());if(s.includes("where")&&!Pt(s,me)){let x=s.some(T=>Ln.includes(T)),R=new Set([...fn,...Ln]),w=n.filter((T,I)=>!dt.has(s[I])&&!R.has(s[I])).join(" ").trim();if(w){let T=x?"mentions":"where";return{shape:T,entityType:null,modifier:"direct",kind:T,object:w}}}if(new Set(["has","have","had"]).has(s[0])){let x=s.length;for(;x>1&&(s[x-1]==="ever"||s[x-1]==="been");)x-=1;if((x>1?me[s[x-1]]:null)==="touches"){let w=n.slice(1,x-1).filter((T,I)=>!dt.has(s[1+I])).join(" ").trim();if(w)return{shape:"when",entityType:null,modifier:"direct",kind:"touches",object:w}}}let r=s,i=Pt(s,me);if(!i&&t){let x=s.map(R=>{if(!Ou(R))return R;let w=t.lemma(R);return Iu.has(w)?w:R});i=Pt(x,me),i&&(r=x)}let a=null;if(!i){let x=s.map(R=>R.length>=4&&Ou(R)&&Lg(R)||R);if(i=Pt(x,me),i){r=x;let R=s.slice(i.start,i.end).findIndex((T,I)=>T!==x[i.start+I]),w=i.start+Math.max(R,0);a={from:s[w],to:x[w]}}}let c=!1;if(!i)for(let x=0;x<s.length;x+=1){let R=Vs[s[x]];if(!(R&&s[x]==="used"&&s[x+1]==="for")&&R&&s.slice(0,x).some(w=>li.has(w))){i={kind:R,start:x,end:x+1},c=!0;break}}if(!i)return null;!c&&i.end-i.start===1&&Vs[s[i.start]]&&s.slice(0,i.start).some(x=>li.has(x))&&(c=!0);let l=x=>a?{...x,fuzzyVerb:a}:x;if(t&&i.end-i.start===1){let x=i.start,R=s[x-1];if((R==="the"||R==="these"||R==="those")&&s[x+1]==="of"&&t.posTags(n)[x]==="NOUN"){let T=n.slice(x+2).filter((I,j)=>!dt.has(s[x+2+j])).join(" ").trim();if(T)return l({shape:"forward",entityType:null,modifier:"direct",kind:i.kind,object:T})}}let u=new Set,d=x=>{if(x)for(let R=x.start;R<x.end;R+=1)u.add(R)};d(i);for(let[x,R]of Object.entries(me)){if(R!==i.kind)continue;let w=x.split(" "),T=i.end;if(w.every((I,j)=>r[T+j]===I)){d({start:T,end:T+w.length});break}}let p=Pt(r,Qe,u);d(p);let f=Pt(r,mn,u);d(f);let m=(x,R)=>n.slice(x,R).filter((w,T)=>!u.has(x+T)&&!dt.has(s[x+T])).join(" ").trim(),h=m(0,i.start),g=m(i.end,n.length);c&&!s.includes("by")&&JR.has(g.toLowerCase())&&(g="");let b=i.kind,y=p?Qe[r.slice(p.start,p.end).join(" ")]:null,$=f?mn[r.slice(f.start,f.end).join(" ")]:"direct",E=r.slice(i.start,i.end).join(" ");if(b==="touches"&&s.includes("when")){let x=h||g;if(x)return l({shape:"when",entityType:null,modifier:"direct",kind:"touches",object:x})}if(b==="touches"&&s.includes("who")&&s.includes("last")){let x=h||g;if(x)return l({shape:"whoLast",entityType:null,modifier:"direct",kind:"touches",object:x})}let _=s.indexOf("by"),v=s.slice(0,i.start).findIndex(x=>li.has(x)),S=v>=0,C=S&&v>_;if(_>=0&&!u.has(_)&&S){let x=(T,I)=>n.slice(T,I).filter((j,k)=>{let P=T+k,U=s[P];return!u.has(P)&&!dt.has(U)&&U!=="by"&&!li.has(U)&&!YR.has(U)&&!XR.has(U)}).join(" ").trim(),[R,w]=C?[x(v+1,n.length),x(_+1,v)]:[x(0,_),x(_+1,n.length)];if(R&&w)return b==="defines"&&Qr.has(r.slice(i.start,i.end).join(" "))?null:l({shape:"ask",entityType:null,modifier:"direct",kind:b,subject:w,object:R});if(w)return l({shape:"forward",entityType:y,modifier:$,kind:b,object:w});if(R)return l({shape:"reverse",entityType:y,modifier:$,kind:b,object:R})}if(c&&_<0&&g&&s[i.start]==="called")return null;if(h&&g){if(b==="defines"&&Qr.has(E)||b==="calls"&&(Mg(g)||QR(h)))return null;let x=c&&_<0?wa[`${s[i.start]} ${s[i.end]}`]:null;return x&&x.role==="agent"&&x.kind===b?l({shape:"ask",entityType:null,modifier:"direct",kind:b,subject:g,object:h}):l(Ws({shape:"ask",entityType:null,modifier:"direct",kind:b,subject:h,object:g},E))}if(g){if(b==="calls"&&Mg(g))return null;let x=p&&p.start>=i.end?null:y;return l(Ws({shape:"reverse",entityType:x,modifier:$,kind:b,object:g},E))}if(b==="inherits"&&!h&&p&&p.start===i.end){let x=r.slice(p.start,p.end).join(" ");if(x)return l({shape:"reverse",entityType:null,modifier:$,kind:b,object:x})}if(h&&!g&&S&&i.end-i.start===1&&Vs[s[i.start]]){if(h.split(/\s+/).length>1)return null;if(b==="touches")return l({shape:"when",entityType:null,modifier:"direct",kind:b,object:h});let x=li.has(s[0]);return l({shape:"reverse",entityType:y,modifier:$,kind:b,object:h,...x?{polar:!0}:{}})}return h?l(Ws({shape:"forward",entityType:y,modifier:"direct",kind:b,object:h},E)):null}var li,YR,XR,JR,Fg,za=M(()=>{Kn();Sn();fr();li=new Set(["is","are","was","were","be","been","being","get","gets","got"]),YR=new Set(["which","what","who","whom","whose"]),XR=new Set(bs.map(e=>e.toLowerCase())),JR=new Set(["recently","lately","yet","already","ever","again"]);Fg={id:"keyword-spot",class:"graph-query",run(e,t={}){let n=ui(e,t.nlp||null);return n?{strategyId:"keyword-spot",class:"graph-query",candidates:[{parsed:n,confidence:.7}]}:null}}});function e_(e,t,n){if(!n||typeof n.posTags!="function"||!t.length)return[];let s=new Set(t.map(i=>i.toLowerCase())),o;try{o=n.posTags(e)}catch{return[]}let r=[];for(let i=0;i<e.length;i+=1){let a=e[i],c=a.toLowerCase();!/^[a-z]+$/.test(a)||Dg.has(c)||!s.has(c)||o[i]==="VERB"&&r.push(c)}return r}function t_(e,t=null){let n=nn(e),s=[],o=[];for(let i of n){let a=i.toLowerCase();/^[a-z]+$/.test(i)&&!Dg.has(a)&&(ZR.has(a)||t&&typeof t.isStopWord=="function"&&t.isStopWord(a))?o.push(i):s.push(i)}let r=e_(n,s,t);return{text:s.join(" "),dropped:o,maybeNoise:r}}var Dg,ZR,zg,Ug=M(()=>{Kn();Sn();Da();za();Dg=new Set([...dt,...ge(bo),...ge(Object.keys(me)),...ge(Object.keys(Qe)),...ge(Object.keys(mn)),...ge(Object.keys(ct)),...ge(yo),...ge($o),...ge(Object.keys(Hn)),...ge(Object.keys(qn)),...ge(Object.keys(nr)),...ge(bs),...ge(ei),...ge(wo),...ge(fn),...ge(Ln),...ge(vn),...ge(Object.keys(or))]),ZR=new Set([...ge(Zr),...ge(ya)]);zg={id:"noise-strip",class:"noise-stripped",run(e,t={}){if(pr(e))return null;let{text:n,dropped:s,maybeNoise:o}=t_(e,t.nlp||null);if(!s.length||!n)return null;let r=pr(n)||ui(n,t.nlp||null);if(!r)return null;if(o.length&&(r.shape==="where"||r.shape==="mentions")&&r.object){let i=r.object.split(/\s+/).filter(a=>!o.includes(a.toLowerCase())).join(" ").trim();i&&i!==r.object&&(r.altObject=i)}return{strategyId:"noise-strip",class:"noise-stripped",candidates:[{parsed:r,confidence:.75,note:`noise-stripped to "${n}"`}]}}}});var Bg=M(()=>{});var Ua,Ba=M(()=>{Ua=()=>{}});function Gg(e,t){return e.shape!==t.shape||e.kind!==t.kind?!1:e.shape==="ask"?mr(e.subject)===mr(t.subject)&&mr(e.object)===mr(t.object):mr(e.object)===mr(t.object)}function Lu(e){let t=(e||[]).filter(l=>l&&Array.isArray(l.candidates)&&l.candidates.length);if(!t.length)return null;let n=[];for(let l of t)for(let u of l.candidates)!u||!u.parsed||n.push({parsed:u.parsed,confidence:typeof u.confidence=="number"?u.confidence:.5,note:u.note||null,via:u.via||null,strategyId:l.strategyId,class:l.class});if(n.some(l=>!Vg(l))&&(n=n.filter(l=>!Vg(l))),!n.length)return null;let s=new Map;for(let l of n)s.has(l.class)||s.set(l.class,[]),s.get(l.class).push(l);let o=[];for(let[l,u]of s){let d=[];for(let p of u){let f=d.find(m=>Gg(m.parsed,p.parsed)&&m.via===p.via);if(f){f.agreed+=1,f.confidence=Math.max(f.confidence,p.confidence),Wg(p.parsed)<Wg(f.parsed)&&(f.parsed=p.parsed);continue}d.push({...p,agreed:1})}d.length&&o.push({class:l,candidates:d})}if(!o.length)return null;let r=l=>Math.max(...l.candidates.map(u=>u.confidence)),i=o[0];for(let l of o)r(l)>r(i)&&(i=l);let a=i.candidates.length===1?i.candidates[0].parsed:{ambiguousParse:!0,candidates:i.candidates.map(l=>l.parsed)},c=o.filter(l=>l!==i).map(l=>l.candidates[0]).filter(l=>!i.candidates.some(u=>Gg(u.parsed,l.parsed)));return{class:i.class,parsed:a,winner:i.candidates[0],alternates:c}}function o_(e){if(!e)return"something else";if(e.ambiguousParse)return"one of several readings";let t=e.object??e.subject??"?";return`${e.kind} "${t}"`}function Hg(e,{describe:t=o_,answerFor:n=null}={}){return(e||[]).map(s=>{let o=s.note||t(s.parsed),r=n&&n(s)||"ask it that way";return`if you mean ${o} then ${r}`})}var mr,n_,Wg,s_,Vg,Pu=M(()=>{mr=e=>String(e||"").trim().toLowerCase().replace(/\s+/g," ").replace(/^(?:the|a|an)\s+/,"").replace(/^commit\s+(?=[0-9a-f]{7,40}$)/,""),n_=/^\s*(?:the|a|an)\s+/i,Wg=e=>[e?.subject,e?.object].filter(t=>n_.test(String(t||""))).length;s_=new Set(["fuzzy","lemma","spell"]),Vg=e=>s_.has(e.via)});function Wa(e){Mu=e}function Ga(){return typeof Mu=="function"?Mu():null}var Mu,hr=M(()=>{Mu=null});function Yg(e,t={},n=i_){let s=[];for(let o of n)try{let r=o.run(e,t);r&&typeof r.then!="function"&&s.push(r)}catch{}return s}var r_,i_,Xg=M(()=>{Sn();Da();za();Ug();Bg();Ba();Pu();hr();r_=[...typeof void 0<"u"?[void 0]:[],...typeof void 0<"u"?[void 0]:[]],i_=[Pg,Fg,zg,...r_]});function jo(e){return a_.test(String(e||"").trim())?"an":"a"}function Va(e){let t=String(e||"").trim();return t&&(/(?:s|x|z|ch|sh)$/.test(t)?`${t}es`:/[^aeiou]y$/.test(t)?`${t.slice(0,-1)}ies`:`${t}s`)}function gr(e){let t=String(e||"");return t&&t[0].toUpperCase()+t.slice(1)}function di(e){let t=(e||[]).map(n=>String(n||"").trim()).filter(Boolean);return t.length===0?"":t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t[t.length-1]}`}var a_,fi=M(()=>{a_=/^[aeiou]/i});var pi,Fu=M(()=>{pi=(e,t,n)=>n});var Hb={};Nt(Hb,{DYNAMIC_TAIL_OK_RE:()=>bd,applyNegationFrames:()=>ci,ask:()=>Zs,classDisplayName:()=>ks,degreeMetric:()=>Mb,metaFallbackEntityAnswer:()=>Ab,normalizeQuery:()=>So,parseQuery:()=>To,parseQueryFull:()=>td,render:()=>Dn,rephraseHint:()=>dd,resolveObject:()=>zn,traverse:()=>sn,worldRelationGraphPayload:()=>iA});function et(e,t){let n=Jg.get(e);n||(n=new Map,Jg.set(e,n));let s=n.get(t);if(s)return s;let o=[];for(let r of e.relations)if(xs(r)===t)for(let i of r.edges)o.push(i);return n.set(t,o),o}function Ne(e,t){let[n,s]=Wu[e]||["result","results"];return t===1?n:s}function wi(e,t,n,s={}){return!e||!t.length?[]:[{kind:"set",class:e,label:`${t.length} ${Ne(e,t.length)}`,ids:t.map(o=>o.id),attrs:{count:t.length},lane:n,...s}]}function ks(e){let t=String(e||"");if(typeof Yn=="function"){let n=Yn(t).join(" ");if(n)return n}return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase()}function ko(e){return l_[e]||e}function m_(e){if(!e?.ambiguousParse||!Array.isArray(e.candidates)||e.candidates.length!==2)return e;let t=e.candidates.find(r=>r?.shape==="meta"),n=e.candidates.find(r=>r!==t);if(!t||!n)return e;let s=String(t.object||"").trim().toLowerCase();if(!s||p_.has(s))return e;let o=String(n.object||"").trim().toLowerCase();return ge(wo).includes(o)?t:e}function g_(e,t){if(!e||e.shape!=="where"||e.altObject||!h_.test(t))return e;let n=ga(t),s=ga(String(e.object||"")),o=s===e.object?e:{...e,object:s},r=nn(s);if(r.length<2)return o;let i=r[r.length-1].toLowerCase();if(!/^[a-z][a-z'-]*$/.test(i)||dt.has(i)||me[i]||i.endsWith("ing"))return o;let a=nn(n).map(l=>l.toLowerCase());for(;a.length&&mb.has(a[a.length-1]);)a.pop();if(a[a.length-1]!==i)return o;let c=r.slice(0,-1).join(" ");return{...e,object:c,altObject:s,verb:i}}function To(e,{nlp:t=void 0}={}){return td(e,{nlp:t}).parsed}function td(e,{nlp:t=void 0}={}){let n=t===void 0?Ga():t,s=String(e||"").trim().replace(/\s+/g," ");if(!s)return{parsed:null,alternates:[],class:null};let o=Cu(ci(So(s)));if(!o)return{parsed:null,alternates:[],class:null};let r=w_(o,n);if(r)return{parsed:r,alternates:[],class:null};let i=Lu(Yg(o,{nlp:n,raw:s}));return i?{parsed:g_(m_(i.parsed),o),alternates:i.alternates||[],class:i.class||null}:{parsed:null,alternates:[],class:null}}function Vu(e,t){return t.length&&nd.has(t[0])?{bw:e.slice(1),blc:t.slice(1)}:{bw:e,blc:t}}function yr(e,t){return pr(e)||ui(e,t)}function w_(e,t){let n=nn(e),s=n.map(o=>o.toLowerCase());return B_(n,s)||G_(n,s)||x_(n,s,t)||bb(e,t,0)||V_(n,s,t)||S_(n,s,t)||I_(n,s,t,0)||M_(n,s,t,0)||vb(n,s)||z_(n,s,t)||H_(n,s,t)||Y_(n,s,t)||J_(n,s,t,0)||K_(n,s,t,0)||yb(n,s,t,0)||od(n,s,t,0)||$b(n,s,t,0)||R_(n,s,t)||$_(n,s)||jb(n,s,t,0)}function $_(e,t){let n=0;y_.has(t[n])&&(n+=1);let s=ut(t[n]);if(!s||s.placeholder||!s.entityType)return null;let o=s.entityType;n+=1;let r=m=>m+1<t.length?wa[`${t[m]} ${t[m+1]}`]:void 0,i=r(n);if(!i)return null;let a=n+2,c=-1,l;for(let m=a;m+1<t.length;m+=1){let h=r(m);if(h){c=m,l=h;break}}if(c<0)return null;let u=e.slice(a,c).join(" ").trim(),d=e.slice(c+2).join(" ").trim();if(!u||!d)return null;let p=(m,h)=>m.role==="object"?{shape:"reverse",kind:m.kind,entityType:o,modifier:"direct",object:h}:{shape:"forward",kind:m.kind,modifier:"direct",object:h},f=p(i,u);return f.entityType=o,{node:"boolean",entityType:o,atoms:[{op:"seed",kind:"set",ast:{node:"clause",clause:f}},{op:"intersection",kind:"set",ast:{node:"clause",clause:p(l,d)}}]}}function qa(e,t){return{node:"boolean",entityType:e,atoms:[{op:"seed",kind:"set",ast:{node:"allOfClass",entityType:e}},t]}}function x_(e,t,n){if(!["do","does","did"].includes(t[0])||!v_.has(t[1]))return null;let s=ut(t[2]);if(!s||s.placeholder||!s.entityType)return null;let o=s.entityType;if(o==="Change")return{node:"miss",reason:`"${t[2]}" isn't an enumerable kind \u2014 a universal check needs a concrete kind (functions, classes, modules, \u2026)`};let r=t[2],i=e.slice(3),a=t.slice(3);if(!i.length)return null;let c=Pt(a,me);if(!c)return{node:"miss",reason:"a universal check needs a known relation verb (import, call, inherit from, test, \u2026)"};let u=i.filter((p,f)=>(f<c.start||f>=c.end)&&!dt.has(a[f])&&a[f]!=="from").join(" ").trim();if(!u)return null;let d=_s(`which ${r} ${i.join(" ")}`,n,1);return!d||d.node==="miss"?{node:"miss",reason:d&&d.reason||"the universal clause didn't parse"}:{node:"universal",entityType:o,kind:c.kind,object:u,complement:qa(o,{op:"difference",kind:"set",ast:d})}}function bb(e,t,n=0){let s=Ag(e);if(!s)return null;let o=ut(s.entWord);if(!o||o.placeholder||!o.entityType)return null;let r=o.entityType;if(r==="Change")return{node:"miss",reason:`"${s.entWord}" isn't an enumerable kind \u2014 a set complement needs a concrete kind (functions, classes, modules, \u2026)`};let i=nn(s.predicate),a=i.map(d=>d.toLowerCase());if(a.length&&a.every(d=>ct[d]))return qa(r,{op:"difference",kind:"qual",filters:a});let c=Pt(a,me);if(!c)return{node:"miss",reason:"a negated set query needs a known relation verb (import, call, inherit from, test, \u2026)"};if(!i.filter((d,p)=>(p<c.start||p>=c.end)&&!dt.has(a[p])&&a[p]!=="from").length)return qa(r,{op:"difference",kind:"set",ast:{node:"existsEdge",entityType:r,kind:c.kind}});let u=_s(`which ${s.entWord} ${s.predicate}`,t,n+1);return!u||u.node==="miss"?{node:"miss",reason:u&&u.reason||"the negated clause didn't parse"}:qa(r,{op:"difference",kind:"set",ast:u})}function S_(e,t,n){let s=0;for(;s<t.length&&E_.has(t[s]);)s+=1;if(!["do","does","did"].includes(t[s]))return null;s+=1;let o=e.slice(s),r=t.slice(s),i=r.indexOf("not");if(i<0)return null;let a=Pt(r,me);if(!a)return null;let l=o.filter((u,d)=>d!==i&&(d<a.start||d>=a.end)&&r[d]!=="from"&&!dt.has(r[d])).join(" ").trim();return l?{node:"forwardComplement",kind:a.kind,subjectTerm:l}:null}function sd(e,t){let n=new Set;for(let s of t)for(let o of et(e,s)){let r=e.byId.get(o.object);r&&r.class&&n.add(r.class)}return n}function wb(e,t){let n=Mt(t),s=n.filter(r=>!pb.has(r)),o=sd(e,s.length?s:n);return o.size===1?[...o][0]:null}function _s(e,t,n){if(n>hb)return{node:"miss",reason:"too deep to resolve"};let s=bb(e,t,n);if(s)return s;let o=nn(e),r=o.map(p=>p.toLowerCase()),i=vb(o,r);if(i)return i;let a=yb(o,r,t,n);if(a)return a;let c=od(o,r,t,n);if(c)return c;let l=$b(o,r,t,n);if(l)return l;let u=jb(o,r,t,n);if(u)return u;let d=yr(e,t);return d?{node:"clause",clause:d}:null}function od(e,t,n,s){for(let o=1;o<t.length;o+=1){let r=vn.includes(t[o]),i=!r&&gb(t[o]);if(!r&&!i||r&&o+1>=t.length||!ut(t[o-1]))continue;let c=e.slice(0,o-1);if(!c.length||c.every(p=>ct[p.toLowerCase()]))continue;let l=yr([...c,Gu].join(" "),n);if(!l||l.shape!=="reverse"&&l.shape!=="forward"||l.modifier&&l.modifier!=="direct")continue;let u=`which ${t[o-1]} ${e.slice(r?o+1:o).join(" ")}`,d=_s(u,n,s+1);return!d||d.node==="miss"?d?{node:"miss",reason:d.reason||"inner clause didn't parse"}:{node:"miss",reason:"inner clause didn't parse"}:{node:l.shape==="reverse"?"reverseSet":"forwardSet",kind:l.kind,entityType:l.entityType,inner:d}}return null}function yb(e,t,n,s){let o=0;(Qs.has(t[o])||rd.has(t[o]))&&(o+=1);let r=ut(t[o]);if(!r||r.placeholder||!r.entityType||(o+=1,nd.has(t[o])&&(o+=1),!j_.has(t[o])||t[o+1]!=="in"))return null;let i=e.slice(o+2);return i.length?id(r.entityType,i,n,s):null}function $b(e,t,n,s){let o=0;if(!Qs.has(t[0]))return null;o+=1;let r=ut(t[o]);if(!r)return null;o+=1;let i=e.slice(o),a=t.slice(o);if(i.length<2)return null;let c=null;for(let h=i.length-1;h>0;h-=1){let g=a.slice(h),b=Pt(g,me);if(b&&b.start===0&&b.end===g.length){c={kind:b.kind,at:h};break}}if(!c)return null;let l=i.slice(0,c.at),u=a.slice(0,c.at);if(!u.some(h=>vn.includes(h)))return null;let d=l,p=u;for(;p.length&&rd.has(p[0]);)d=d.slice(1),p=p.slice(1);if(!p.length||!ut(p[0]))return null;let f=Qs.has(p[0])?d.join(" "):`which ${d.join(" ")}`,m=_s(f,n,s+1);return!m||m.node==="miss"?{node:"miss",reason:m&&m.reason||"the embedded subject clause didn't parse"}:{node:"forwardSet",kind:c.kind,entityType:r.entityType,inner:m}}function R_(e,t,n){for(let s=0;s<t.length;s+=1){if(!k_.has(t[s])||t[s-1]==="of")continue;let o=s===t.length-1,r=s+1<t.length&&!!me[t[s+1]];if(!o&&!r)continue;let i=[...e.slice(0,s),Gu,...e.slice(s+1)],a=yr(i.join(" "),n);if(!(!a||a.shape!=="reverse"&&a.shape!=="forward")&&a.object===Gu&&!(a.modifier&&a.modifier!=="direct"))return{node:a.shape==="reverse"?"reverseSet":"forwardSet",kind:a.kind,entityType:a.entityType,inner:{node:"prevSet"}}}return null}function I_(e,t,n,s=0){if(t[0]!=="when")return null;let o=1;if(!__.has(t[o]))return null;o+=1;let r=-1;for(let d=t.length-1;d>=o;d-=1)if(T_.has(t[d])){r=d;break}if(r<0)return null;let i=e.slice(o,r),a=t.slice(o,r);for(;a.length&&A_.has(a[a.length-1]);)i=i.slice(0,-1),a=a.slice(0,-1);for(;a.length&&C_.has(a[0]);)i=i.slice(1),a=a.slice(1);if(!i.length||!a.some(d=>vn.includes(d)))return null;let c=Qs.has(a[0])?i.join(" "):`which ${i.join(" ")}`,l=_s(c,n,s+1);if(!l||l.node==="miss")return l?{node:"miss",reason:l.reason||"the inner set of the temporal query didn't parse"}:{node:"miss",reason:"the inner set of the temporal query didn't parse"};let u=ut(a[0]);return{node:"temporal",inner:l,entityType:u&&u.entityType||null}}function vb(e,t){if(!N_.has(t[0]))return null;let n=1,s=null;if(t[n]!=="changed"){let i=ut(t[n]);if(!i||i.placeholder)return null;s=i.entityType,n+=1}if(t[n]!=="changed"||(n+=1,t[n]==="ever"&&(n+=1),!O_.has(t[n])))return null;let o=t[n],r=e.slice(n+1).join(" ").trim();return r?{node:"commitFilter",op:o,pivotRaw:r,entityType:s}:{node:"miss",reason:`"changed ${o}" needs a date or commit afterward`}}function id(e,t,n,s){let o=t.map(r=>r.toLowerCase());if(o.some(r=>vn.includes(r))){let r=t,i=o;for(;i.length&&rd.has(i[0]);)r=r.slice(1),i=i.slice(1);if(i.length&&ut(i[0])){let a=Qs.has(i[0])?r.join(" "):`which ${r.join(" ")}`,c=_s(a,n,s+1);return!c||c.node==="miss"?{node:"miss",reason:c&&c.reason||"the owner clause of this membership query didn't parse"}:{node:"membershipSet",entityType:e,inner:c}}}return{node:"membership",entityType:e,term:t.join(" ")}}function M_(e,t,n,s=0){if(t[0]!=="where"||!L_.has(t[1])||!mb.has(t[t.length-1]))return null;let o=e.slice(2,t.length-1),r=t.slice(2,t.length-1);for(;r.length&&P_.has(r[0]);)o=o.slice(1),r=r.slice(1);if(!o.length||!r.some(l=>vn.includes(l)))return null;let i=ut(r[0]);if(!i)return null;let a=Qs.has(r[0])?o.join(" "):`which ${o.join(" ")}`,c=_s(a,n,s+1);return!c||c.node==="miss"?{node:"miss",reason:c&&c.reason||"the inner set of the location query didn't parse"}:{node:"whereSet",inner:c,entityType:i.entityType||null}}function D_(e){let t=new Set,n=[];for(let s of e){if(!s||!F_.test(s))continue;let o=s.toLowerCase();t.has(o)||(t.add(o),n.push(s))}return n}function z_(e,t,n){if(t.length===2&&t[0]==="which"&&(t[1]==="ones"||t[1]==="one"))return{node:"anaphora",mode:"list",filter:{type:"all"}};let s=-1,o=!1;for(let d=1;d<t.length;d+=1){if(!ei.includes(t[d]))continue;if(t[d-1]==="of"){s=d,o=!0;break}let p=t.slice(0,d).join(" ");if(d===t.length-1&&(yo.includes(p)||$o.includes(p))){s=d;break}}if(s<0)return null;let r=(o?t.slice(0,s-1):t.slice(0,s)).join(" "),i=yo.includes(r)||/^(how many|how much|count|number|quantity|total)\b/.test(r)?"count":"list",a=U_(e.slice(s+1),n);if(a===void 0)return{node:"miss",reason:"the follow-up filter didn't parse"};let c=o?s-1:s,l=D_(e.slice(0,c)),u={node:"anaphora",mode:i,filter:a};return l.length>=2&&(u.candidateTerms=l),u}function U_(e,t){let n=0,s=e.map(a=>a.toLowerCase());for(;n<s.length&&b_.has(s[n]);)n+=1;let o=e.slice(n),r=s.slice(n);if(!o.length)return{type:"all"};if(r.every(a=>ct[a]))return{type:"qual",filters:r};if(o.length===1){let a=ut(r[0]);if(a&&!a.placeholder&&a.entityType)return{type:"entity",entityType:a.entityType}}let i=yr(`what ${o.join(" ")}`,t);if(i&&(i.shape==="reverse"||i.shape==="forward")&&i.object)return{type:"clause",clause:i}}function B_(e,t){let n;if(t[0]==="is"&&t[1]==="there")n=2;else if(t[0]==="are"&&t[1]==="there")n=2;else return null;let s=t[n];if(s==="a"||s==="an"||s==="any")n+=1;else return null;let o=n<t.length?ut(t[n]):null;if(!o||o.placeholder||!o.entityType)return null;let r=o.entityType;n+=1;let i=t.slice(n),a=e.slice(n);if(i.length&&i[i.length-1]==="anywhere"?(i=i.slice(0,-1),a=a.slice(0,-1)):i.length>=2&&i[i.length-2]==="at"&&i[i.length-1]==="all"&&(i=i.slice(0,-2),a=a.slice(0,-2)),!i.length)return{node:"exists",entityType:r,term:null,scopeModule:null};if(i[0]==="called"||i[0]==="named"){if(i.length<2)return{node:"miss",reason:`"${i[0]}" needs a name afterward`};let c=i.indexOf("in",1);if(c>0){let u=a.slice(1,c).join(" ").trim(),d=a.slice(c+1).join(" ").trim();return!u||!d?{node:"miss",reason:'a named existence check needs both a name and a module after "in"'}:{node:"exists",entityType:r,term:u,scopeModule:d}}let l=a.slice(1).join(" ").trim();return l?{node:"exists",entityType:r,term:l,scopeModule:null}:{node:"miss",reason:`"${i[0]}" needs a name afterward`}}if(i[0]==="in"){let c=a.slice(1).join(" ").trim();return c?{node:"exists",entityType:r,term:null,scopeModule:c}:{node:"miss",reason:'"in" needs a module afterward'}}return null}function W_(e,t){if(!t.length)return null;let n=`${e} ${t.join(" ")}`,s=Gs(n).slice(e.length).trim(),o=nn(s),r=o.findIndex(a=>a.toLowerCase()==="in");if(r<0)return null;let i=o.slice(r+1).join(" ").trim();return i?{scope:i}:{node:"miss",reason:'"in" needs a scope afterward'}}function G_(e,t){if(t[0]!=="is"&&t[0]!=="are"||t[1]==="there")return null;let n=-1,s=!1;for(let l=1;l<t.length;l+=1)if(ct[t[l]]){n=l,s=t[l-1]==="not";break}if(n<0)return null;let o=t.indexOf("by",n+1);if(o>0&&Vs[t[n]]){let l=o+1;for(;l<t.length&&(t[l]==="the"||t[l]==="a"||t[l]==="an");)l+=1;let u=t[l];if(u&&!Jm.has(u))return null}let r=W_(t[n],e.slice(n+1));if(r?.node==="miss")return r;let i=1;t[i]==="the"&&(i+=1);let a=s?n-1:n;a>i&&(t[a-1]==="a"||t[a-1]==="an")&&(a-=1);let c=a>i?e.slice(i,a).join(" ").trim():"";return c?{node:"qualCheck",term:c,qualifier:t[n],negated:s,scope:r?.scope||null}:{node:"miss",reason:'"is/are <qualifier>" needs a named thing to check first'}}function V_(e,t,n){if(!["do","does","did","is","are","was","were"].includes(t[0]))return null;let s=t.indexOf("not",1);if(s<0)return null;let o=yr(e.filter((r,i)=>i!==s).join(" "),n);return!o||o.shape!=="ask"?null:{...o,negated:!0}}function H_(e,t,n){let s=yo.find(d=>t.slice(0,d.split(" ").length).join(" ")===d);if(!s)return null;let o=s.split(" ").length;for(;o<t.length&&(t[o]==="the"||t[o]==="a"||t[o]==="all");)o+=1;let r=[];for(;o<t.length&&ct[t[o]];)r.push(t[o]),o+=1;let i=o<t.length?ut(t[o]):null;if(!i)return{node:"miss",reason:"count needs a known entity kind (functions, classes, modules, \u2026)"};let a=t[o];o+=1;let c=e.slice(o),l=t.slice(o).some(d=>!dt.has(d)&&!xb.has(d)),u;if(l){let d=_s(`which ${a} ${c.join(" ")}`,n,1);if(!d||d.node==="miss")return{node:"miss",reason:"the count restrictor didn't parse"};u=d}else u={node:"allOfClass",entityType:i.entityType};return r.length&&(u={node:"qualifier",filters:r,inner:u}),{node:"count",entityType:i.entityType,base:u}}function K_(e,t,n,s){let o=0,r=!1,i=null;for(let y of Eb){let $=y.split(" ");if(t.slice(0,$.length).join(" ")===y){i=y,o=$.length;break}}if(!i)if(t[0]==="what"||t[0]==="which")r=!0,o=1;else return null;for(;o<t.length&&ad.has(t[o]);)o+=1;let a=[];for(;o<t.length&&ct[t[o]];)a.push(t[o]),o+=1;let c=o<t.length?ut(t[o]):null;if(!c||c.placeholder||c.entityType==="Change")return!r&&o<t.length&&o===t.length-1&&/^[a-z]+$/.test(t[o])&&!me[t[o]]&&!bs.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${Sb}`}:null;let l=c.entityType,u=t[o];o+=1;let d=e.slice(o),p=t.slice(o).some(y=>!dt.has(y)&&!xb.has(y)),f=t.slice(o),m=d;(f[0]==="is"||f[0]==="are")&&(f=f.slice(1),m=m.slice(1));let h=r&&q_.has(f[0]);if(r&&(p&&!h||d.length===0))return null;let g,b=!1;if(p){let y=h?m:d,$=_s(`which ${[...a,u,...y].join(" ")}`,n,(s||0)+1);if(!$||$.node==="miss")return{node:"miss",reason:$&&$.reason||"the list filter didn't parse"};g=$,b=!0}else g={node:"allOfClass",entityType:l},a.length&&(g={node:"qualifier",filters:a,inner:g});return{node:"list",entityType:l,base:g,scoped:b}}function Y_(e,t,n){let s=null,o=-1;for(let m=0;m<t.length;m+=1){let h=t.slice(m,m+2).join(" ");if(Hn[h]){s=Hn[h],o=m;break}if(Hn[t[m]]){s=Hn[t[m]],o=m;break}}if(!s)return null;let r=null,i=null;for(let m=o;m<t.length;m+=1)if(qn[t[m]]){r=qn[t[m]],i=t[m];break}if(!r){for(let m=o-1;m>=0;m-=1)if(qn[t[m]]){r=qn[t[m]],i=t[m];break}}let a=t.includes("connected")||t.slice(o,o+2).join(" ")==="most connected"||["largest","biggest","smallest"].includes(t[o]),c=["important","significant","central","key","core","essential","critical","principal"],l=t.some(m=>c.includes(m));!r&&(a||l)&&(r=qn.connections,i="connections");let u,d=null;for(let m of t){let h=ut(m);if(h&&!h.placeholder){u=h.entityType,d=m;break}}if(!d&&(u=i?Qm[i]:void 0,!u))return{node:"miss",reason:"a superlative needs an entity kind (module, class, function, \u2026)"};if(!r)return{node:"miss",reason:"name what to rank by (imports, callers, methods, tests, or connections)"};let p=["needs","need","needing","lacks","lack","lacking","misses","missing"],f=t.some(m=>p.includes(m))?s==="most"?"fewest":"most":s;return{node:"superlative",entityType:u,metric:r,metricNoun:i,extreme:f}}function J_(e,t,n,s){if(t[0]!=="find")return null;let o=1;for(;o<t.length&&ad.has(t[o]);)o+=1;if(o>=t.length)return null;let r=ut(t[o]);if(r&&!r.placeholder&&r.entityType!=="Change"&&o+1<t.length&&X_.has(t[o+1])){let a=e.slice(o+2).join(" ").trim();if(a)return{node:"find",entityType:r.entityType,term:a}}let i=ut(t[t.length-1]);if(i&&!i.placeholder&&i.entityType!=="Change"){let a=e.slice(o,t.length-1).join(" ").trim();if(a)return{node:"find",entityType:i.entityType,term:a}}return t.some(a=>vn.includes(a))?null:o===t.length-1&&/^[a-z]+$/.test(t[o])&&!me[t[o]]&&!bs.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${Sb}`}:null}function Q_(e,t){if(t[0]!=="find")return null;let n=1;for(;n<t.length&&ad.has(t[n]);)n+=1;let s=-1;for(let i=n+1;i<t.length;i+=1)if(vn.includes(t[i])){s=i;break}if(s<0)return null;let o=ut(t[s-1]);if(!o||o.placeholder||o.entityType==="Change")return null;let r=e.slice(n,s-1).join(" ").trim();return r?{entityType:o.entityType,term:r,relIdx:s}:null}function Z_(e,t,n,s,o,r){let{branches:i,ops:a}=Ka(n,s),c=null,l=[];for(let u=0;u<i.length;u+=1){let d=i[u],p=d.map(y=>y.toLowerCase()),f=u===0?"intersection":a[u-1],m=Vu(d,p);if(m.blc.length&&m.blc.every(y=>ct[y])){l.push({op:f,kind:"qual",filters:m.blc});continue}if(p[0]==="of"||p[0]==="in"){let y=id(e,d.slice(1),o,r);if(y.node==="miss")return{miss:y.reason};l.push({op:f,kind:"set",ast:y});continue}let h=d,g=Pt(p,me);g?c=d.slice(g.start,g.end):c&&(h=[...c,...d]);let b=kb(`${t} ${h.join(" ")}`,o,r);if(!b||b.node==="miss")return{miss:b&&b.reason||"a clause in the combination didn't parse"};l.push({op:f,kind:"set",ast:b})}return{atoms:l}}function jb(e,t,n,s){let o=Q_(e,t);if(o){let{entityType:R,term:w,relIdx:T}=o,I=t.slice(T+1),j=e.slice(T+1);if(!I.length)return{node:"miss",reason:`a relative clause needs a predicate after "${t[T]}"`};let k=Z_(R,`which ${t[T-1]}`,I,j,n,s+1);if(k.miss)return{node:"miss",reason:k.miss};let P=[{op:"seed",kind:"set",ast:{node:"find",entityType:R,term:w}},...k.atoms];return P.length===1?P[0].ast:{node:"boolean",entityType:R,atoms:P}}let r=0;for(;r<t.length&&Qs.has(t[r]);)r+=1;let i=r>0,a=[];for(;r<t.length&&ct[t[r]];)a.push(t[r]),r+=1;let c=r<t.length?ut(t[r]):null;if(!c){let R=r+1<t.length?ut(t[r+1]):null;if(Qg.has(t[r])&&R&&R.entityType==="Commit"&&r+2===t.length)return{node:"recentCommits"};if(nd.has(t[r])){let w=r+1;w<t.length&&(t[w]==="the"||t[w]==="a"||t[w]==="an")&&(w+=1);let T=w+1<t.length?ut(t[w+1]):null;if(Qg.has(t[w])&&T&&T.entityType==="Commit"&&w+2===t.length)return{node:"recentCommits"}}return(i||a.length)&&R&&/^[a-z]+$/.test(t[r])&&!me[t[r]]&&!dt.has(t[r])&&!hd.has(t[r])?{node:"find",entityType:R.entityType,term:e[r]}:null}let l=c.entityType,u=t[r];r+=1;let d=t.slice(r),p=e.slice(r),f=!1;d.length&&vn.includes(d[0])&&(f=!0,d=d.slice(1),p=p.slice(1));let m=d[0]==="of"||d[0]==="in",h=d.length>0&&gb(d[0]),g=p.length>0&&Ka(d,p).branches.some(R=>{let{blc:w}=Vu(R,R.map(T=>T.toLowerCase()));return w.length&&w.every(T=>ct[T])}),b=p.length>0?Ka(d,p).branches:[],y=!1;if(b.length>1){let R=b[0].map(T=>T.toLowerCase()),w=Pt(R,me);w&&w.start===0&&(y=b.slice(1).every(T=>{let I=T.map(k=>k.toLowerCase()),j=Pt(I,me);return j&&j.start===0?j.kind===w.kind:!j}))}let $=!1;if(b.length>1){let R=b[0].map(T=>T.toLowerCase()),w=Pt(R,me);w&&w.start===0&&($=b.slice(1).every(T=>{let I=T.map(k=>k.toLowerCase()),j=Pt(I,me);return!!j&&j.start===0&&j.end-j.start===1}))}if(!(a.length||f||m||h||g||y||$))return null;if(!p.length){let R={node:"allOfClass",entityType:l};return a.length?{node:"qualifier",filters:a,inner:R,entityType:l}:{node:"miss",reason:"nothing to filter or traverse"}}let E=c.placeholder?"what":`which ${u}`,{branches:_,ops:v}=Ka(d,p),S=null,C=[];for(let R=0;R<_.length;R+=1){let w=_[R],T=w.map(H=>H.toLowerCase()),I=R===0?"seed":v[R-1],j=Vu(w,T);if(j.blc.length&&j.blc.every(H=>ct[H])){C.push({op:I,kind:"qual",filters:j.blc});continue}if(T[0]==="of"||T[0]==="in"){let H=id(l,w.slice(1),n,s+1);if(H.node==="miss")return H;C.push({op:I,kind:"set",ast:H});continue}let k=w,P=Pt(T,me);P?S=w.slice(P.start,P.end):S&&(k=[...S,...w]);let U=kb(`${E} ${k.join(" ")}`,n,s+1);if(!U||U.node==="miss")return{node:"miss",reason:U&&U.reason||"a clause in the combination didn't parse"};C.push({op:I,kind:"set",ast:U})}if(C[0].kind!=="set")return{node:"miss",reason:"start with a clause, then combine with and/or/but-not"};let x;return C.length===1?x=C[0].ast:x={node:"boolean",entityType:l,atoms:C},a.length&&(x={node:"qualifier",filters:a,inner:x,entityType:l}),x}function kb(e,t,n){if(n>hb)return{node:"miss",reason:"too deep to resolve"};let s=nn(e),o=s.map(a=>a.toLowerCase()),r=od(s,o,t,n);if(r)return r;let i=yr(e,t);return i?{node:"clause",clause:i}:null}function Ka(e,t){let n=Object.keys(nr).sort((a,c)=>c.split(" ").length-a.split(" ").length),s=[],o=[],r=0,i=0;for(;i<e.length;){let a=null;for(let c of n){let l=c.split(" ");if(e.slice(i,i+l.length).join(" ")===c){a={c,len:l.length};break}}a&&i>r?(s.push(t.slice(r,i)),o.push(nr[a.c]),i+=a.len,r=i):a?(i+=a.len,r=i):i+=1}return s.push(t.slice(r)),{branches:s,ops:o}}function Rb(e){let t=Zg.get(e);if(t)return t;t=new Map;for(let n of e.individuals||[])n.class==="Module"&&t.set(En(n.label),n);return Zg.set(e,t),t}function _b(e,t){let n=Rb(e),s=[];for(let o of t){let r=e.byId.get(o);if(!r||r.class==="Module")continue;let i=Ao(r),a=i?n.get(En(i)):null;a&&s.push(a)}return gn(s)}function tT(e){let t=eb.get(e);if(t)return t;t=new Map;let n=Rb(e);for(let s of e.individuals||[]){if(s.class==="Module")continue;let o=Ao(s),r=o?n.get(En(o)):null;r&&(t.has(r.id)||t.set(r.id,[]),t.get(r.id).push(s))}return eb.set(e,t),t}function cd(e,t,n,s){let o=br[t];if(o&&Js.has(n)){let d=et(e,o).filter(p=>s.has(p.object));return gn(d.map(p=>e.byId.get(p.subject)).filter(p=>p&&p.class===n))}let a=(!!o&&[...s].some(d=>Js.has(e.byId.get(d)?.class))?[...Mt(t),o]:Mt(t)).flatMap(d=>et(e,d)),c=a.filter(d=>s.has(d.object));t==="cochange"&&(c=c.concat(a.filter(d=>s.has(d.subject)).map(d=>({...d,subject:d.object,object:d.subject}))));let l=gn(c.map(d=>e.byId.get(d.subject)).filter(Boolean));if(!n||n==="Change")return l;let u=l.filter(d=>d.class===n);if(Tb(t,n)){let d=new Set(c.map(f=>f.object)),p=new Set([...s].filter(f=>!d.has(f)));return gn([...u,..._b(e,p)])}return u.length?u:n!=="Module"&&l.some(d=>d.class==="Module")?fd(e,new Set(l.filter(d=>d.class==="Module").map(d=>d.id)),n):[]}function sT(e){let t=new Set;for(let n of["touches","touchesSymbol"])for(let s of et(e,n)){let o=e.byId.get(s.subject);o?.class==="Commit"&&t.add(String(o.label||"").toLowerCase())}return e.individuals.filter(n=>n.class==="Commit").map(n=>String(n.label||"").toLowerCase()).filter(n=>n&&!t.has(n)).sort()}function oT(e,t){let n=new Set(cd(e,"touches","Commit",t).map(o=>String(o.label||"").toLowerCase())),s=sT(e);for(let o of t)for(let r of e.byId.get(o)?.derived_from||[]){let i=nT.exec(String(r||""));if(!i)continue;let a=i[1].toLowerCase(),c=s.find(l=>l.startsWith(a)||a.startsWith(l));c&&n.add(c)}return n.size}function gi(e,t,n){let s=Mt(t).flatMap(o=>et(e,o)).filter(o=>n.has(o.subject));return gn(s.map(o=>e.byId.get(o.object)).filter(Boolean))}function gn(e){let t=new Set,n=[];for(let s of e)s&&!t.has(s.id)&&(t.add(s.id),n.push(s));return n}function rT(e,t){let n=En(t);if(!n)return[];let s=`${n}/`;return e.individuals.filter(o=>o.class==="Module"&&En(o.label).startsWith(s))}function Hu(e){let t=tb.get(e);if(t)return t;let n=new Set;for(let i of et(e,"reexports")){n.add(String(i.object).toLowerCase());let a=e.byId.get(i.object);a&&n.add(String(a.label).toLowerCase())}let s=new Set,o=new Set;for(let i of et(e,"tests"))s.add(i.object),o.add(i.subject);let r=new Map;for(let i of et(e,"defines"))r.set(i.object,i.subject);return t={exported:n,testedModules:s,testModules:o,moduleOfSymbol:r},tb.set(e,t),t}function wr(e,t){return t?t.class==="Module"?t.id:Hu(e).moduleOfSymbol.get(t.id)||null:null}function Ab(e,t){let n=String(t||"").trim().toLowerCase();if(!n)return null;let s=(e?.individuals||[]).filter(d=>iT.has(d.class)&&String(d.label).toLowerCase()===n);if(s.length!==1)return null;let o=s[0],r=wr(e,o),i=r&&e.byId.get(r)?.label||String((o.attributes||[]).find(d=>d.key==="site")?.value||"").split(":")[0]||null,a=Ne(o.class,1),c=a==="attribute"?"an":"a",l=i?`, ${pi("defined-in",o.id,"defined in")} ${i}`:"",u=o.class==="Class"?` or "which classes inherit from ${o.label}"`:"";return{text:`${o.label} is ${c} ${a} in this codebase${l} \u2014 try "describe ${o.label}"${u}.`,hit:o,modLabel:i}}function Xa(e,t,n){let s=gn(sr.flatMap(i=>gi(e,i,new Set([t])))),o=n?s.filter(i=>i.class===n):s;if(o.length)return o;let r=tT(e).get(t)||[];return n?r.filter(i=>i.class===n):r}function ld(e,t,n=null){let s=Rs(e,t,n);if(!(s.match&&s.tier===1)){let o=rT(e,t);if(o.length)return{kind:"dir",mods:o}}return s.match?{kind:"single",id:s.match.id,entityClass:s.match.class,label:s.match.label}:{kind:"miss"}}function Cb(e,t,n,s,o){let r=o||(()=>!0),i=Xa(e,t,s).filter(r);if(i.length||!Ob(e,n))return{own:i,inherited:[],viaId:null,viaLabel:null};for(let a of Ib(e,t)){let c=e.byId.get(a);if(!c)continue;let l=Xa(e,a,s).filter(r);if(l.length)return{own:i,inherited:l,viaId:a,viaLabel:c.label}}return{own:i,inherited:[],viaId:null,viaLabel:null}}function Ro(e,t,n){if(!n)return!1;switch(n.via){case"visibility":return String((t.attributes||[]).find(o=>o.key==="visibility")?.value||"public").toLowerCase()===n.value;case"attr":return!!(t.attributes||[]).find(s=>s.key===n.attr)?.value;case"exported":{let s=Hu(e).exported;return s.has(String(t.label).toLowerCase())||s.has(String(t.id).toLowerCase())}case"tested":{let s=wr(e,t),o=Hu(e),r=s?e.byId?.get?.(s):null;return s&&(o.testModules.has(s)||r&&xo(String(r.label).toLowerCase()))?!1:(!!s&&o.testedModules.has(s))===n.value}default:return!1}}function ud(e){return et(e,"inherits")}function qu(e,t){return ud(e).filter(n=>n.object===t).map(n=>n.subject)}function nb(e,t){return ud(e).filter(n=>n.subject===t).map(n=>n.object)}function aT(e,t){let n=new Set,s=[...qu(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of qu(e,o))n.has(r)||s.push(r)}}return n}function Ib(e,t){let n=new Set,s=[...nb(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of nb(e,o))n.has(r)||s.push(r)}}return n}function Ob(e,t){let n=sb.get(e);if(n||(n=new Map,sb.set(e,n)),n.has(t))return n.get(t);let s=ud(e).some(o=>{let r=e.byId.get(o.subject),i=e.byId.get(o.object);return!!r&&!!i&&r.class===t&&i.class===t});return n.set(t,s),s}function ob(e,t){let n=String(e.label||"").toLowerCase();if(t.every(o=>n.includes(o)))return"label";let s=(e.attributes||[]).map(o=>String(o.value??"").toLowerCase());return t.every(o=>s.some(r=>r.includes(o)))?"attr":null}function ib(e){return e.slice().sort((t,n)=>rb[n.via]-rb[t.via]||String(t.ind.label).length-String(n.ind.label).length).map(t=>t.ind)}function ab(e,t){let n=String(t||"").trim().toLowerCase();if(n.length<4)return!1;let s=Ss(n);if(Es(String(e.label||"").toLowerCase(),n,s)<=s)return!0;for(let o of _o(e.label))if(Es(o,n,s)<=s)return!0;return!1}function Nb(e,t,n){let s=e.individuals.filter(c=>c.class===t),o=[..._o(n)];if(!o.length||!s.length)return{narrow:[],broad:[]};let r=Ob(e,t),i=[];for(let c of s){let l=ob(c,o);if(l){i.push({ind:c,via:l});continue}if(!r)continue;[...aT(e,c.id)].some(d=>{let p=e.byId.get(d);return!!p&&!!ob(p,o)})&&i.push({ind:c,via:"chain"})}if(i.length||!r)return{narrow:ib(i),broad:[]};let a=new Map;for(let c of s)for(let l of Ib(e,c.id)){if(!a.has(l)){let u=e.byId.get(l);u&&u.class===t&&ab(u,n)&&a.set(l,{ind:u,via:"chain"})}for(let u of qu(e,l)){if(u===c.id||a.has(u))continue;let d=e.byId.get(u);d&&d.class===t&&ab(d,n)&&a.set(u,{ind:d,via:"chain"})}}return{narrow:[],broad:ib([...a.values()])}}function cT(e){return[...Ca(Ia(e)).entries()].sort((t,n)=>n[1]-t[1]||t[0].localeCompare(n[0])).map(([t])=>({id:`pkg:${t}`,label:t,class:"Package"}))}function on(e,t,n){switch(t.node){case"clause":return sn(e,t.clause,n).matches||[];case"allOfClass":return t.entityType==="Package"?cT(e):e.individuals.filter(s=>s.class===t.entityType);case"find":{let{narrow:s,broad:o}=Nb(e,t.entityType,t.term);return s.length?s:o}case"existsEdge":{let s=new Set(Mt(t.kind).flatMap(o=>et(e,o)).map(o=>o.subject));return e.individuals.filter(o=>s.has(o.id)&&(!t.entityType||o.class===t.entityType))}case"forwardComplement":{let s=Rs(e,t.subjectTerm,n&&n.contextId);if(!s.match)return[];let o=wb(e,t.kind);if(!o)return[];let r=new Set(gi(e,t.kind,new Set([s.match.id])).map(i=>i.id));return e.individuals.filter(i=>i.class===o&&!r.has(i.id))}case"commitFilter":return Ku(e,t).matches;case"reverseSet":{let s=new Set(on(e,t.inner,n).map(o=>o.id));return cd(e,t.kind,t.entityType,s)}case"forwardSet":{let s=new Set(on(e,t.inner,n).map(o=>o.id));return gi(e,t.kind,s)}case"prevSet":{let s=n&&n.prev;return Array.isArray(s)?s.map(o=>e.byId.get(o)).filter(Boolean):[]}case"membership":{let s=ld(e,t.term,n&&n.contextId);if(s.kind==="dir"){if(!t.entityType||t.entityType==="Module")return s.mods;let i=new Set(s.mods.map(c=>c.id));return gn(sr.flatMap(c=>gi(e,c,i))).filter(c=>c.class===t.entityType)}if(s.kind==="miss")return[];let{own:o,inherited:r}=Cb(e,s.id,s.entityClass,t.entityType);return o.length?o:r}case"membershipSet":{let s=on(e,t.inner,n);return s.length?gn(s.flatMap(o=>Xa(e,o.id,t.entityType))):[]}case"qualifier":return t.inner.node==="membership"?Fb(e,t,n).matches:on(e,t.inner,n).filter(o=>t.filters.every(r=>Ro(e,o,ct[r])));case"boolean":return Lb(e,t,n);case"anaphora":return Pb(e,t,n).matches;default:return[]}}function Lb(e,t,n){let s=[];for(let o of t.atoms){if(o.op==="seed"){s=on(e,o.ast,n);continue}if(o.kind==="qual"){let i=c=>o.filters.every(l=>Ro(e,c,ct[l])),a=c=>o.filters.every(l=>{let u=lT(ct[l]);return u?Ro(e,c,u):!Ro(e,c,ct[l])});s=o.op==="difference"?s.filter(a):s.filter(i);continue}let r=new Set(on(e,o.ast,n).map(i=>i.id));if(o.op==="intersection")s=s.filter(i=>r.has(i.id));else if(o.op==="difference")s=s.filter(i=>!r.has(i.id));else if(o.op==="union"){let i=new Set(s.map(a=>a.id));for(let a of on(e,o.ast,n))i.has(a.id)||(i.add(a.id),s.push(a))}}return s}function uT(e,t){if(!Array.isArray(t)||t.length<2)return null;let n=new Set,s=[];for(let o of t){let r=zn(e,o);r&&r.match&&!n.has(r.match.id)&&(n.add(r.match.id),s.push(r.match))}return s.length>=2?s:null}function Pb(e,t,n){let o=uT(e,t.candidateTerms);if(!o){let d=n&&n.prev;if(!Array.isArray(d)||!d.length)return{compositeMiss:!0,reason:"no-prev",matches:[]};o=d.map(p=>e.byId.get(p)).filter(Boolean)}let r=o,i=t.filter;if(i&&i.type==="qual")r=r.filter(d=>i.filters.every(p=>Ro(e,d,ct[p])));else if(i&&i.type==="entity")r=r.filter(d=>d.class===i.entityType);else if(i&&i.type==="clause"){let d=zn(e,i.clause.object);if(!d.match)r=[];else{let p=br[i.clause.kind],f=[...Mt(i.clause.kind),...p?[p]:[]],m=new Set(f.flatMap(h=>et(e,h)).filter(h=>h.object===d.match.id).map(h=>h.subject));r=r.filter(h=>m.has(h.id))}}let a=d=>d.length&&d.every(p=>p.class===d[0].class)?d[0].class:null,c=i&&i.type==="entity"?i.entityType:a(o),l=r.length?a(r):c;if(t.mode==="count")return{compositeKind:"count",count:r.length,entityType:l,matches:[]};let u=wi(l,r,"anaphora",{bound:!0});return{compositeKind:"set",matches:r,entityType:l,referents:u}}function Mb(e,t,n){let s=n.kind==="*"?dT:[n.kind,...n.sibling?[n.sibling]:[]],o=0;for(let r of s)for(let i of et(e,r)){let a=i.subject===t.id,c=i.object===t.id;if(n.dir==="out"&&a){if(n.filter){let l=e.byId.get(i.object);if(!l||l.class!==n.filter)continue}o+=1}else(n.dir==="in"&&c||n.dir==="both"&&(a||c))&&(o+=1)}return o}function fT(e){let t=e.individuals.filter(s=>s.class==="Commit"),n=s=>String((s.attributes||[]).find(o=>o.key==="date")?.value||"");return t.sort((s,o)=>n(o).localeCompare(n(s))),{compositeKind:"recentCommits",matches:t}}function Ku(e,t){let{op:n,pivotRaw:s,entityType:o=null}=t,r=f=>String((f.attributes||[]).find(m=>m.key==="date")?.value||"").slice(0,10),i=null,a=null,c=null;if(pT.test(s))i=s;else{let{match:f,ambiguous:m}=zn(e,s,{expectedClass:"Commit"});f&&!m&&f.class==="Commit"&&r(f)&&(a=f.id,c=f.label,i=r(f))}if(!i)return{compositeKind:"commitFilter",op:n,pivotRaw:s,entityType:o,pivotResolved:!1,matches:[]};let l=e.individuals.filter(f=>f.class==="Commit"&&f.id!==a&&r(f)).filter(f=>{let m=r(f);return n==="since"?m>=i:n==="before"?m<i:n==="after"?m>i:m===i}).sort((f,m)=>r(m).localeCompare(r(f))||String(f.id).localeCompare(String(m.id))),u=o&&o!=="Commit"&&o!=="Change"?gn(l.flatMap(f=>zb(e,f,o).matches)):null,d=u||l,p=[];if(d.length){let f=u?o:"Commit";p.push({kind:"set",class:f,label:`${d.length} ${Ne(f,d.length)} ${n} ${s}`,ids:d.map(m=>m.id),attrs:{count:d.length,op:n,...a?{pivot:a}:{}},lane:"commitFilter"})}return a&&p.push({kind:"event",class:"Commit",label:c,ids:[a],attrs:{date:i},lane:"commitFilter"}),{compositeKind:"commitFilter",op:n,pivotRaw:s,pivotDate:i,pivotResolved:!0,entityType:o,windowCount:l.length,matches:d,referents:p}}function mT(e,t,n){let s=on(e,t.inner,n),o=new Set(s.map(a=>a.id));if(!o.size)return{compositeKind:"temporal",matches:[],entityType:t.entityType,innerCount:0};let r=cd(e,"touches","Commit",o),i=a=>String((a.attributes||[]).find(c=>c.key==="date")?.value||"");return r.sort((a,c)=>i(c).localeCompare(i(a))),{compositeKind:"temporal",matches:r,entityType:t.entityType,innerCount:s.length}}function hT(e,t,n){let s=on(e,t.inner,n);return{compositeKind:"whereSet",matches:s,entityType:t.entityType,sites:s.map(o=>(o.attributes||[]).find(r=>r.key==="site")?.value||null)}}function gT(e,t){let n=e.individuals.filter(a=>a.class===t.entityType);if(t.metric?.kind==="tests"&&t.entityType==="Module"){let a=new Set(et(e,"tests").map(c=>c.subject));n=n.filter(c=>!a.has(c.id)&&!xo(String(c.label).toLowerCase()))}let s=n.map(a=>({ind:a,score:Mb(e,a,t.metric)})).sort((a,c)=>t.extreme==="most"?c.score-a.score:a.score-c.score);if(!s.length)return{compositeKind:"superlative",entityType:t.entityType,matches:[]};let o=s[0].score,r=s.filter(a=>a.score===o).map(a=>a.ind),i=r.length>=2?wi(t.entityType,r,"superlative"):[{kind:"entity",class:t.entityType,label:r[0].label,ids:[r[0].id],attrs:{},lane:"superlative"}];return i.push({kind:"measure",label:`${o} ${t.metricNoun}`,ids:[],attrs:{metric:o},lane:"superlative"}),{compositeKind:"superlative",entityType:t.entityType,metricNoun:t.metricNoun,extreme:t.extreme,score:o,matches:r,referents:i}}function Fb(e,t,n){let s=t.node==="qualifier"&&t.inner.node==="membership"?t:null,o=s?s.inner:t,r=o.entityType,i=s?m=>s.filters.every(h=>Ro(e,m,ct[h])):null,a=m=>wi(r,m,"membership"),c=ld(e,o.term,n&&n.contextId);if(c.kind==="dir"){let m;if(!r||r==="Module")m=c.mods;else{let h=new Set(c.mods.map(g=>g.id));m=gn(sr.flatMap(g=>gi(e,g,h))).filter(g=>g.class===r)}return i&&(m=m.filter(i)),{compositeKind:"set",matches:m,entityType:r,referents:a(m)}}if(c.kind==="miss")return{compositeKind:"set",matches:[],entityType:r};let{own:l,inherited:u,viaLabel:d}=Cb(e,c.id,c.entityClass,r,i),p=!l.length&&u.length>0,f=p?u:l;return{compositeKind:"membership",entityType:r,matches:f,inheritedNotOwn:p,viaLabel:d,ownerLabel:c.label,referents:a(f)}}function bT(e,t){let{entityType:n,term:s,scopeModule:o}=t,r=null;if(o){let a=zn(e,o,{expectedClass:"Module"});if(!a.match)return{compositeKind:"exists",entityType:n,term:s,scopeModule:o,scopeMiss:!0,matches:[]};r=a.match}if(s){let a=zn(e,s,{expectedClass:n}),c=!r||a.match&&wr(e,a.match)===r.id,l=a.match&&c;return{compositeKind:"exists",entityType:n,term:s,scopeModule:o,scopeMatch:r,matches:l?[a.match]:[]}}let i=r?fd(e,new Set([r.id]),n):e.individuals.filter(a=>a.class===n);return{compositeKind:"exists",entityType:n,term:null,scopeModule:o,scopeMatch:r,matches:i}}function wT(e,t,n){let s=wr(e,t);return n.kind==="dir"?n.mods.some(o=>o.id===t.id||o.id===s):s===n.id||Xa(e,n.id).some(o=>o.id===t.id)}function yT(e,t,n){let{term:s,qualifier:o,negated:r,scope:i}=t,a=Rs(e,s,n.contextId);if(a.unresolvedPronoun)return{compositeKind:"qualCheck",qualCheckMiss:"pronoun",term:s,matches:[]};if(!a.match)return{compositeKind:"qualCheck",qualCheckMiss:"unresolved",term:s,matches:[]};if(i){let d=ld(e,i,n.contextId);if(d.kind==="miss")return{compositeKind:"qualCheck",qualCheckMiss:"scope",term:s,scope:i,matches:[]};if(!wT(e,a.match,d))return{compositeKind:"qualCheck",qualCheckMiss:"outsideScope",term:s,scope:i,subjectLabel:a.match.label,scopeLabel:d.kind==="dir"?i:d.label,matches:[]}}let c=Ro(e,a.match,ct[o]),l=r?!c:c,u=[{kind:"entity",class:a.match.class,label:a.match.label,ids:[a.match.id],attrs:{},lane:"qualCheck"}];return{compositeKind:"qualCheck",subject:a.match,qualifier:o,negated:r,holds:l,matches:[a.match],referents:u}}function $T(e,t,n){let s=zn(e,t.object);if(!s||!s.match)return{compositeKind:"universal",universalMiss:"unresolved",object:t.object,matches:[]};let o=on(e,{node:"allOfClass",entityType:t.entityType},n),r=Lb(e,t.complement,n),i=r.length===0;return{compositeKind:"universal",entityType:t.entityType,kind:t.kind,object:s.match.label,holds:i,total:o.length,counter:r,matches:i?o:r}}function vT(e,t,n){if(t.node==="reverseSet"&&t.kind==="touches"&&t.entityType==="Commit")return new Set(on(e,t.inner,n).map(s=>s.id));if(t.node==="clause"&&t.clause?.shape==="reverse"&&t.clause.kind==="touches"&&t.clause.entityType==="Commit"){let{objMatch:s,ambiguous:o}=sn(e,t.clause,n);return s&&!o?new Set([s.id]):null}return null}function xT(e,t,n={}){if(t.node==="miss")return{compositeMiss:!0,reason:t.reason||null,matches:[]};if(t.node==="exists")return bT(e,t);if(t.node==="qualCheck")return yT(e,t,n);if(t.node==="universal")return $T(e,t,n);if(t.node==="count"){if(t.base.node==="commitFilter"){let a=Ku(e,t.base);return a.pivotResolved?{compositeKind:"count",count:a.matches.length,entityType:t.entityType,matches:[]}:a}let i=vT(e,t.base,n);return i?{compositeKind:"count",count:oT(e,i),entityType:t.entityType,matches:[]}:{compositeKind:"count",count:on(e,t.base,n).length,entityType:t.entityType,matches:[]}}if(t.node==="list")return{compositeKind:"list",matches:on(e,t.base,n),entityType:t.entityType,scoped:t.scoped};if(t.node==="worldRelation")return sA(e,t);if(t.node==="superlative")return gT(e,t);if(t.node==="temporal")return mT(e,t,n);if(t.node==="whereSet")return hT(e,t,n);if(t.node==="recentCommits")return fT(e);if(t.node==="commitFilter")return Ku(e,t);if(t.node==="anaphora")return Pb(e,t,n);if(t.node==="membership"||t.node==="qualifier"&&t.inner.node==="membership")return Fb(e,t,n);if(t.node==="find"){let{narrow:i,broad:a}=Nb(e,t.entityType,t.term);return{compositeKind:"find",entityType:t.entityType,term:t.term,matches:i.length?i:a,broad:!i.length&&a.length>0}}if((t.node==="reverseSet"||t.node==="forwardSet")&&t.inner.node==="prevSet"&&!(Array.isArray(n.prev)&&n.prev.length))return{compositeMiss:!0,reason:"no-prev",matches:[]};let s=on(e,t,n),o=t.entityType||null,r=wi(o,s,t.node==="qualifier"?"qualifierListing":"compositeSet");return{compositeKind:"set",matches:s,entityType:o,referents:r}}function Yu(){return'compositional queries also work: "which functions call X and call Y", "what calls something that imports X", "public methods of X", "list functions" / "show me the classes", "how many classes", "which module has the most imports", "find me the payment class", or (after a listing) "which of those are tested"'}function ET(e){let t=["Function","Method"].includes(e.class)?`${e.label}()`:e.label;if(e.class==="Module")return t;let n=Ao(e);return n?`${t} in ${n}`:t}function Xu(e){return!e||typeof e!="object"?!1:Array.isArray(e)?e.some(Xu):Array.isArray(e.filters)&&e.filters.some(t=>ct[String(t).toLowerCase()]?.via==="tested")?!0:Object.values(e).some(Xu)}function ST(e,t){return!["Function","Method"].includes(t)||!Xu(e)?null:"This index records tests edges module to module, so it holds no function-grain coverage to filter on \u2014 ask whether the module a function lives in is tested instead."}function jT(e,t,n){if(t.compositeMiss)return t.reason==="no-prev"?{content:'"those"/"them" needs a previous answer to refer to \u2014 ask a listing question first, then follow up.',miss:!0,ambiguous:!1}:{content:`couldn't compile this compositional question${t.reason?` (${t.reason})`:""}. ${Yu()}.`,miss:!0,ambiguous:!1};if(t.compositeKind==="exists"){if(t.scopeMiss)return{content:`no module matching "${t.scopeModule}" found in the index.`,miss:!0,ambiguous:!1};let s=Ne(t.entityType,1),o=Ne(t.entityType,2),r=t.scopeMatch?` in ${t.scopeMatch.label}`:"";if(t.term){if(!t.matches.length)return{content:`No \u2014 no ${s} named "${t.term}" found${r}.`,miss:!0,ambiguous:!1};let i=t.matches[0],a=Ao(i),c=i.class==="Module"?"":a?`, ${pi("defined-in",i.id,"defined in")} ${a}`:"";return{content:`Yes \u2014 ${i.label} is a ${s}${c}.`,miss:!1,ambiguous:!1,matches:t.matches}}return t.matches.length?{content:`Yes \u2014 ${js(t.matches)}${r}.`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`No \u2014 no ${o} found${r}.`,miss:!0,ambiguous:!1}}if(t.compositeKind==="qualCheck"){if(t.qualCheckMiss==="pronoun")return{content:`"${t.term}" needs a selected node to refer to \u2014 click a node first, or name it directly.`,miss:!0,ambiguous:!1};if(t.qualCheckMiss==="unresolved")return{content:`couldn't find "${t.term}" in the index to check.`,miss:!0,ambiguous:!1};if(t.qualCheckMiss==="scope")return{content:`couldn't find "${t.scope}" in the index to check inside.`,miss:!0,ambiguous:!1};if(t.qualCheckMiss==="outsideScope")return{content:`No \u2014 ${t.subjectLabel} isn't in ${t.scopeLabel}.`,miss:!0,ambiguous:!1};let s=t.subject.label,o=t.negated?`not ${t.qualifier}`:t.qualifier,r=t.negated?t.qualifier:`not ${t.qualifier}`;return{content:`${t.holds?"Yes":"No"} \u2014 ${s} is ${t.holds?o:r}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="universal"){if(t.universalMiss==="unresolved")return{content:`couldn't find "${t.object}" in the index to check.`,miss:!0,ambiguous:!1,matches:[]};let s=Ne(t.entityType,t.total),o=d_(t.kind);return t.holds?{content:`Yes \u2014 all ${t.total} ${s} ${o} ${t.object}.`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`No \u2014 ${t.counter.length} of ${t.total} ${s} do not ${o} ${t.object}: ${js(t.counter)}.`,miss:!1,ambiguous:!1,matches:t.counter}}if(t.compositeKind==="count"){let s=t.entityType?Ne(t.entityType,t.count):t.count===1?"result":"results";return{content:`${t.count} ${s}.`,miss:!1,ambiguous:!1,matches:[]}}if(t.compositeKind==="list"){if(!t.matches.length)return{content:`no ${Ne(t.entityType,2)} in this index.`,miss:!0,ambiguous:!1,matches:[]};let s=!["Module","Package","Commit","Fact","Utterance","Session","Source","Rule"].includes(t.entityType),o=!t.scoped&&s&&t.matches.length>rt?` \u2014 narrow with "${Ne(t.entityType,2)} in <module>"`:"";return{content:`${js(t.matches)}${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="worldRelation"){let s=Fn(t.asked),o=go[t.relation].nouns[1];return t.pairs.length?{content:`${t.pairs.map(i=>`${i.subject.label||i.subject.id} ${i.reads} ${i.object}`).join("; ")}.`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`no ${o} on record for ${s} in this graph.`,miss:!0,ambiguous:!1,matches:[]}}if(t.compositeKind==="membership"){if(!t.matches.length)return{content:`nothing in the index matches that${t.entityType?` (${Ne(t.entityType,2)})`:""}. ${Xs(n)}`,miss:!0,ambiguous:!1,matches:[]};if(t.inheritedNotOwn){let s=Ne(t.entityType,2);return{content:`${t.ownerLabel?`${t.ownerLabel} has no own ${s}`:`no own ${s}`} \u2014 inherited from ${t.viaLabel}: ${js(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches,inheritedNotOwn:!0}}return{content:`${js(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="find"){let s=Ne(t.entityType,1);if(!t.matches.length)return{content:`no ${Ne(t.entityType,2)} found matching "${t.term}".`,miss:!0,ambiguous:!1,matches:[]};let o=t.matches.length===1?ET(t.matches[0]):js(t.matches);return t.broad?{content:`no exact ${s} named "${t.term}", but found a related ${t.matches.length===1?s:Ne(t.entityType,2)}: ${o}.`,miss:!1,ambiguous:!1,matches:t.matches,relatedNotExact:!0}:{content:`${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="recentCommits"){if(!t.matches.length)return{content:"no commits recorded in this index.",miss:!0,ambiguous:!1,matches:[]};let s=i=>String((i.attributes||[]).find(a=>a.key==="date")?.value||""),o=t.matches.slice(0,tn).map(i=>{let a=s(i).slice(0,10),c=(i.attributes||[]).find(l=>l.key==="message")?.value||"";return`${i.label}${a?` (${a})`:""}${c?` \u2014 ${c}`:""}`}),r=t.matches.length>tn?` \u2026+${t.matches.length-tn} more`:"";return{content:`${t.matches.length} recent commit(s): ${o.join(", ")}${r}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="commitFilter"){if(!t.pivotResolved)return{content:`"${t.pivotRaw}" isn't a recognized date (yyyy-mm-dd) or a known commit \u2014 try "what changed since 2026-06-01" or "what changed before <commit>".`,miss:!0,ambiguous:!1,matches:[]};if(!t.windowCount)return{content:`no commits recorded ${t.op} ${t.pivotRaw}.`,miss:!0,ambiguous:!1,matches:[]};if(t.entityType&&t.entityType!=="Commit"&&t.entityType!=="Change"){let i=Ne(t.entityType,t.matches.length||2);return t.matches.length?{content:`${js(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`no ${i} changed ${t.op} ${t.pivotRaw}.`,miss:!0,ambiguous:!1,matches:[]}}let s=i=>String((i.attributes||[]).find(a=>a.key==="date")?.value||""),o=t.matches.slice(0,tn).map(i=>{let a=s(i).slice(0,10),c=(i.attributes||[]).find(l=>l.key==="message")?.value||"";return`${i.label}${a?` (${a})`:""}${c?` \u2014 ${c}`:""}`}),r=t.matches.length>tn?` \u2026+${t.matches.length-tn} more`:"";return{content:`${t.matches.length} commit(s) changed ${t.op} ${t.pivotRaw}: ${o.join(", ")}${r}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="superlative"){if(!t.matches.length)return{content:`no ${Ne(t.entityType,2)} to rank in this index.`,miss:!0,ambiguous:!1};let s=t.extreme==="most"?"the most":"the fewest",o=t.matches.length>1?` (${t.matches.length}-way tie)`:"";return{content:`${js(t.matches)} \u2014 ${s} ${t.metricNoun} (${t.score})${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="temporal"){let s=t.innerCount||0,o=t.entityType?Ne(t.entityType,s||2):s===1?"entity":"entities",r=s===1?"was":"were";if(!s)return{content:`nothing in the index matches the inner set, so there is no change history to date. ${Xs(n)}`,miss:!0,ambiguous:!1,matches:[]};if(!t.matches.length)return{content:`no recorded commit touched the ${s} ${o} in that set in this index. ${Xs(n)}`,miss:!0,ambiguous:!1,matches:[]};let i=t.matches[0],a=(i.attributes||[]).find(d=>d.key==="date")?.value||"";if(!a)return{content:`the ${o} in that set ${r} last touched by commit ${i.label}, but this index records no commit dates \u2014 regenerate the graph to attach mgx:commitDate.`,miss:!0,ambiguous:!1,matches:t.matches};let c=(i.attributes||[]).find(d=>d.key==="message")?.value||"",l=String(a).slice(0,10),u=t.matches.length-1;return{content:`the ${o} in that set ${r} last touched by commit ${i.label} on ${l}${c?` ("${c}")`:""}${u?`; ${u} earlier commit${u===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="whereSet"){let s=t.entityType?Ne(t.entityType,2):"entities";if(!t.matches.length)return{content:`nothing in the index matches that clause (${s}), so there is no location to cite. ${Yu()}.`,miss:!0,ambiguous:!1,matches:[]};let o=t.matches.map((i,a)=>Ju(i,t.sites[a])||`${i.label} has no recorded code location in this index.`),r=t.matches.filter((i,a)=>Ju(i,t.sites[a]));return{content:o.join(" "),miss:r.length===0,ambiguous:!1,matches:t.matches}}if(!t.matches.length){let s=ST(e,t.entityType)||Xs(n);return{content:`nothing in the index matches that${t.entityType?` (${Ne(t.entityType,2)})`:""}. ${s}`,miss:!0,ambiguous:!1,matches:[]}}return{content:`${js(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}}function dd(){return`"which <functions|classes|modules> <imports|calls|uses|inherits from|tests> <name>" or "what does <name> <import|call|export>" or "what uses <name>" or "where is <name> defined" / "where is <name> mentioned" or "when did <name> change" or "which commits touched <name>" or "which changes touch commit <sha>"/"what did commit <sha> touch" (a commit's own changes) or plainly "what calls this" (about a selected node) or "what does <term> mean"/"what is a <ClassName>" (about the graph's own vocabulary). `+Yu()}function Xs(e=null){return e&&ri(e)===0?Su:`Try "who touched <a module that actually has commits>" or "/describe <module>" to see what's in the index.`}function _o(e){return new Set(String(e).toLowerCase().split(/[^a-z0-9]+/).filter(Boolean))}function Ja(e){if(e.length<5)return e;let t=e.replace(/(ing|ers|ors|er|or)$/,"");return t===e?e:t.length>=3&&t[t.length-1]===t[t.length-2]?t.slice(0,-1):t}function Db(e){return String(e||"").replace(/\.[a-z0-9]+$/i,"").toLowerCase().replace(/[/\-_.]+/g,"")}function kT(e){return String(e||"").trim().replace(/^(?:the|a|an)\s+/i,"").toLowerCase().replace(/[\s\-_]+/g,"")}function mi(e,t,{expectedClass:n=null}={}){let s=String(t||"").trim();if(!s)return{match:null,candidates:[],tier:null,ambiguous:!1};let o=s.toLowerCase(),r=n?e.individuals.filter(g=>g.class===n):e.individuals,i=o.match(/^(commit[:\s])?([0-9a-f]{7,40})$/);if(i){let g=i[2],b=r.filter(y=>y.class==="Commit"&&(String(y.id).toLowerCase().startsWith(`commit:${g}`)||String(y.label).toLowerCase().startsWith(g)));if(b.length===1)return{match:b[0],candidates:[],tier:1,ambiguous:!1};if(b.length>1)return{match:b[0],candidates:b.slice(1,5),tier:1,ambiguous:!0};if(i[1])return{match:null,candidates:[],tier:null,ambiguous:!1}}let a=r.find(g=>String(g.label).toLowerCase()===o||String(g.id).toLowerCase()===o);if(a)return{match:a,candidates:[],tier:1,ambiguous:!1};let c=`ext:${o}`,l=null;e:for(let g of e.relations)for(let b of g.edges)if(String(b.object).toLowerCase()===c){l=b.object;break e}if(l&&!n)return{match:{id:l,label:s,class:null},candidates:[],tier:2,ambiguous:!1};let u=s.split(/\s+and\s+/i).map(g=>g.trim()).filter(Boolean);if(u.length>1){let g=new Set;for(let b of u){let y=mi(e,b,{expectedClass:n});y.match&&!y.ambiguous&&g.add(y.match.id)}if(g.size>1)return{match:null,candidates:[],tier:null,ambiguous:!1}}let d=[],p=!o.includes("/")&&/^[\w$]+(\.[\w$]+)+$/.test(o);if(p){let g=o.split(".").pop();for(let b of r){let y=String(b.label||"").toLowerCase();b.class==="Module"?y.split("/").pop()===o&&d.push({ind:b,score:1e3-Math.abs(y.length-o.length)}):y.includes(o)?d.push({ind:b,score:2e3-Math.abs(y.length-o.length)}):y.endsWith(`.${g}`)&&d.push({ind:b,score:1500-Math.abs(y.length-o.length)})}}else{let g=[..._o(s)],b=o.split(/\s+/).find(v=>v.includes("/")),y=b?b.split("/").pop().replace(/\.[a-z0-9]+$/,""):null,E=s.trim().replace(/^(?:the|a|an)\s+/i,"").trim().split(/\s+/).filter(Boolean).length>=2,_=E?kT(s):null;for(let v of r){let S=String(v.label||"").toLowerCase(),C=S.split("/").pop().replace(/\.[a-z0-9]+$/,"");if(C===o){d.push({ind:v,score:5e3});continue}if(o.length>=4&&(C.startsWith(o)||C.endsWith(o))){d.push({ind:v,score:4e3-Math.abs(C.length-o.length)});continue}if(E){let w=Db(v.label);if(w&&w===_){d.push({ind:v,score:5e3});continue}let T=/[/_-]/.test(v.label)||/\.[a-z0-9]+$/i.test(String(v.label||""));if(w&&T&&_.length>=4&&w.includes(_)){d.push({ind:v,score:2e3-Math.abs(w.length-_.length)});continue}}if(v.class==="Module"){let w=Ja(o);if(w!==o&&w===Ja(C)){let T=Ss(o);if(Es(C,o,T)>T){d.push({ind:v,score:3e3-Math.abs(C.length-o.length)});continue}}}if(o.length>=4&&S.includes(o)){d.push({ind:v,score:1e3-Math.abs(S.length-o.length)});continue}let x=_o(v.label),R=g.filter(w=>x.has(w)).length;R>0&&(!y||x.has(y))&&d.push({ind:v,score:R/g.length*zu})}}if(d.sort((g,b)=>b.score-g.score),d.length){let[g,...b]=d,y=b.filter(E=>E.score===g.score),$=g.score>=zu?b.filter(E=>E.score>=zu):b;return{match:g.ind,candidates:$.slice(0,4).map(E=>E.ind),tier:3,ambiguous:y.length>0}}let f=p||o.includes("/"),m=null,h=!f&&typeof vo=="function"?vo(e.proseIndex,s).filter(g=>!n||e.byId.get(g.id)?.class===n):[];if(h.length){let[g,...b]=h,y=e.byId.get(g.id);if(y){let $=b.filter(E=>E.score===g.score);if(m={match:y,candidates:b.slice(0,4).map(E=>e.byId.get(E.id)).filter(Boolean),tier:4,ambiguous:$.length>0,matchedVia:"prose"},!m.ambiguous&&g.via!=="spell")return m}}if(!i&&o.length>=4){let g=Ss(o),b=g+1,y=[];for(let $ of r){let E=Es(String($.label||"").toLowerCase(),o,g);if(E>0)for(let _ of _o($.label)){if(E<=0)break;E=Math.min(E,Es(_,o,g))}E<b?(b=E,y=[$]):E===b&&E<=g&&y.push($)}if(b<=g&&y.length===1)return{match:y[0],candidates:[],tier:5,ambiguous:!1,matchedVia:"fuzzy"};if(b<=g&&y.length>1&&!m){let[$,...E]=y;return{match:$,candidates:E.slice(0,4),tier:5,ambiguous:!0,matchedVia:"fuzzy"}}}return m||{match:null,candidates:[],tier:null,ambiguous:!1}}function Uu(e,t){let n=Db(t),s=[..._o(t)],o=[];for(let r of _o(e))n.includes(r)||s.some(i=>Ja(i)===Ja(r))||Ya.has(r)||Wb.has(r)||o.push(r);return o}function Ha(e,t){if(!e?.match||e.tier!==3||e.matchedVia)return e;if(e.ambiguous){let s=[e.match,...e.candidates||[]],o=s.map(r=>new Set(Uu(t,r.label))).reduce((r,i)=>r.filter(a=>i.has(a)),Uu(t,s[0].label));return o.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:o,nearestLabel:Fn(s.slice(0,4).map(r=>r.label))}:e}let n=Uu(t,e.match.label);return n.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:n,nearestLabel:e.match.label}:e}function zn(e,t,n={}){let{expectedClass:s=null}=n;if(!s){let o=String(t||"").trim(),r=o.replace(RT,"").trim(),i=r.match(_T);if(i){let a=r.slice(0,i.index).trim(),c=Qe[i[1].toLowerCase()];if(a&&c){let l=Ha(mi(e,a,{expectedClass:c}),a);if(l?.match?.id&&!l.ambiguous)return l}}if(r&&r!==o){let a=Ha(mi(e,r,n),r);if(a?.match?.id&&!a.ambiguous)return a}return Ha(mi(e,t,n),t)}return Ha(mi(e,t,n),t)}function Rs(e,t,n){if(bo.includes(String(t||"").trim().toLowerCase())){if(!n)return{match:null,candidates:[],tier:null,ambiguous:!1,unresolvedPronoun:!0};let s=e.byId.get(n);return s?{match:s,candidates:[],tier:1,ambiguous:!1}:{match:null,candidates:[],tier:null,ambiguous:!1,unresolvedPronoun:!0}}return zn(e,t)}function fd(e,t,n){let s=[];for(let o of et(e,"defines")){if(!t.has(o.subject))continue;let r=e.byId.get(o.object);r&&r.class===n&&s.push(r)}return s}function zb(e,t,n,s={}){let o=!n||n==="Change"||n==="Commit",r=o||n==="Module",i=o||Js.has(n),a=[...r?["touches"]:[],...i?["touchesSymbol"]:[]],c=a.flatMap(l=>et(e,l)).filter(l=>l.subject===t.id).map(l=>e.byId.get(l.object)).filter(Boolean);return n&&Js.has(n)&&(c=c.filter(l=>l.class===n)),{matches:c,objMatch:t,commitSubject:!0,ambiguous:!1,candidates:[],traversal:`${a.join("+")} edges where subject = commit ${t.label}`,...s}}function IT(e,t){let n=new Set(String(t||"").toLowerCase().split(/[\s-]+/).filter(Boolean));return(e.individuals||[]).filter(s=>s.class==="Module"&&pd.has(cb(s.label))).map(s=>({ind:s,named:n.has(cb(s.label))?1:0,depth:String(s.label).split("/").length,fixture:CT(s.label)?1:0})).sort((s,o)=>o.named-s.named||s.depth-o.depth||s.fixture-o.fixture||String(s.ind.label).localeCompare(String(o.ind.label))).map(s=>s.ind)}function OT(e,t,n){return e==="reverse"&&(t==="imports"||t==="calls")&&(!n||n==="Module")}function md(e){return(e?.attributes||[]).find(t=>NT.has(t.prop))?.value||null}function LT(e){return e==="SchemaClass"?"a class in the graph's schema":e==="SchemaPredicate"?"a predicate (relation) in the graph's schema":`${jo(e)} ${e} in this graph's vocabulary`}function sn(e,t,{contextId:n=null,prev:s=null,pinnedObjMatch:o=null}={}){if(!t)return{matches:[],objMatch:null,candidates:[],traversal:null,ambiguous:!1};if(t.node)return xT(e,t,{contextId:n,prev:s});if(t.ambiguousParse){let j=t.candidates.map(k=>{let P=sn(e,k,{contextId:n,prev:s});return{parsed:k,result:P,rendered:Dn(k,P,e)}});return{matches:[],objMatch:null,candidates:t.candidates,traversal:null,ambiguous:!0,branches:j}}let{shape:r,kind:i,entityType:a}=t;if(r==="meta"){let j=String(t.object||"").trim(),k=j.toLowerCase(),P=(e.individuals||[]).find(U=>{if(!md(U))return!1;if(String(U.label).toLowerCase()===k)return!0;let H=(U.attributes||[]).find(X=>X.key==="token")?.value;return H&&String(H).toLowerCase()===k});if(!P){let U=Ab(e,j);return U?{matches:[U.hit],objMatch:U.hit,candidates:[],ambiguous:!1,metaCodeClass:!0,metaFallbackText:U.text,traversal:`schema lookup for "${j}" (miss), then unique code-entity individual by label`}:{matches:[],objMatch:null,candidates:[],traversal:`schema lookup for "${j}"`,ambiguous:!1}}return{matches:[P],objMatch:P,candidates:[],traversal:`schema lookup for "${j}"`,ambiguous:!1}}if(r==="mentions"){let j=String(t.object||"").trim();return{matches:(typeof vo=="function"?vo(e.proseIndex,j):[]).map(U=>e.byId.get(U.id)).filter(Boolean),objMatch:null,candidates:[],ambiguous:!1,mentionsShape:!0,traversal:`proseIndex word lookup for "${j}"`}}if(r==="where"&&TT.test(String(t.object||"").trim())){let j=IT(e,t.object);return{matches:j,objMatch:j[0]||null,candidates:j.slice(1,5),ambiguous:!1,entryPointShape:!0,traversal:`Module individuals with an entry-point basename (${[...pd].join("/")}), ranked query-named basename first, then shallower path, then non-test path`}}if(t.modifier&&t.modifier!=="direct"&&!OT(r,i,a))return{matches:[],objMatch:null,candidates:[],ambiguous:!1,unsupportedModifier:!0,traversal:`modifier "${t.modifier}" requested for a "${i}" query \u2014 no closure traversal exists for this combination yet`};if(r==="ask"){let j=Rs(e,t.subject,n),k=Rs(e,t.object,n);if(!j.match||!k.match||j.ambiguous||k.ambiguous)return{matches:[],objMatch:k.match,candidates:k.candidates,traversal:null,ambiguous:!1,answer:null,unresolvedPronoun:!!(j.unresolvedPronoun||k.unresolvedPronoun)};let[P,U]=[j.match,k.match];i==="touches"&&U.class==="Commit"&&P.class!=="Commit"&&([P,U]=[U,P]);let H=br[i],X=[...new Set(H?[...Mt(i),H]:Mt(i))],Q=X.flatMap(L=>et(e,L)).filter(L=>L.subject===P.id&&L.object===U.id);return{matches:Q,answer:t.negated?Q.length===0:Q.length>0,objMatch:k.match,subjMatch:j.match,candidates:[],traversal:`${X.join("+")} edge from ${P.label} to ${U.label}`,ambiguous:!1}}let c;if(o)c={match:o,candidates:[],ambiguous:!1,matchedVia:null};else{if(c=Rs(e,t.object,n),t.altObject&&t.altObject!==t.object){let j=Rs(e,t.altObject,n),k=!!c.match&&!c.ambiguous,P=!!j.match&&!j.ambiguous;!k&&P?c=j:k&&P&&c.match.id!==j.match.id&&(c={...c,ambiguous:!0,candidates:[j.match,...c.candidates||[]]})}if(t.kind==="tests"&&c.match&&!c.ambiguous&&!String(t.object||"").includes("/")){let j=U=>U.replace(/\.(?:test|spec|tests)(?=\.[^.]+$)/,""),k=j(String(t.object||"").trim().toLowerCase()),P=(e.individuals||[]).find(U=>{if(U.class!=="Module"||U.id===c.match.id)return!1;let H=String(U.label||"").toLowerCase().split("/").pop();return H!==j(H)&&j(H)===k});P&&(c={...c,ambiguous:!0,candidates:[P,...c.candidates||[]]})}}let{match:l,candidates:u,ambiguous:d,unresolvedPronoun:p,matchedVia:f,unplacedWords:m,nearestLabel:h}=c;if(!l)return{matches:[],objMatch:null,candidates:u,traversal:null,ambiguous:!1,unresolvedPronoun:p,unplacedWords:m,nearestLabel:h};if(d){let k=gn([l,...u||[]]).slice(0,rt).map(P=>{let U=sn(e,t,{contextId:n,prev:s,pinnedObjMatch:P});return{candidate:P,result:U,rendered:Dn(t,U,e)}});return{matches:[],objMatch:l,candidates:u,traversal:null,ambiguous:!0,branches:k}}if(r==="where"){let j=(l.attributes||[]).find(k=>k.key==="site")?.value||null;return{matches:[l],objMatch:l,candidates:u,ambiguous:d,matchedVia:f,whereShape:!0,site:j,traversal:j?`site attribute of ${l.label}`:`class + defining module of ${l.label}`}}if(r==="when"){let j=U=>String((U.attributes||[]).find(H=>H.key==="date")?.value||""),k;if(l.class==="Commit")k=[l];else{let U=["touches","touchesSymbol"].flatMap(X=>et(e,X)).filter(X=>X.object===l.id),H=new Set;k=[];for(let X of U){if(H.has(X.subject))continue;H.add(X.subject);let Q=e.byId.get(X.subject);Q&&Q.class==="Commit"&&k.push(Q)}k.sort((X,Q)=>j(Q).localeCompare(j(X)))}let P=k.length&&j(k[0])?[{kind:"event",class:"Commit",label:k[0].label,ids:[k[0].id],attrs:{date:j(k[0]).slice(0,10)},lane:"when"}]:[];return{matches:k,objMatch:l,candidates:u,ambiguous:d,matchedVia:f,whenShape:!0,referents:P,traversal:`touches+touchesSymbol edges where object = ${l.label}, newest commit date first`}}if(r==="whoLast"){let j=X=>String((X.attributes||[]).find(Q=>Q.key==="date")?.value||""),k=["touches","touchesSymbol"].flatMap(X=>et(e,X)).filter(X=>X.object===l.id),P=new Set,U=[];for(let X of k){if(P.has(X.subject))continue;P.add(X.subject);let Q=e.byId.get(X.subject);Q&&Q.class==="Commit"&&U.push(Q)}U.sort((X,Q)=>j(Q).localeCompare(j(X)));let H=U.length&&j(U[0])?[{kind:"event",class:"Commit",label:U[0].label,ids:[U[0].id],attrs:{date:j(U[0]).slice(0,10)},lane:"whoLast"}]:[];return{matches:U,objMatch:l,candidates:u,ambiguous:d,matchedVia:f,whoLastShape:!0,referents:H,traversal:`touches+touchesSymbol edges where object = ${l.label}, newest commit's author`}}if(i==="touches"&&l.class==="Commit")return zb(e,l,a,{candidates:u,ambiguous:d,matchedVia:f});if(r==="forward"){let j=br[i],P=!!(j&&l.class&&Js.has(l.class))?[...new Set([...Mt(i),j])]:Mt(i);if(a&&a!=="Change"){let V=sd(e,P),W=Du[a];if(V.size&&!V.has(a)&&!(W&&V.has(W)))return{matches:[],objMatch:l,candidates:u,ambiguous:d,matchedVia:f,forwardGrainMiss:!0,wantClasses:[...V],traversal:`${P.join("+")} edges where subject = ${l.label} (grain mismatch: this "${i}" relation never targets a ${ks(a)})`}}let H=P.flatMap(V=>et(e,V)).filter(V=>V.subject===l.id).map(V=>e.byId.get(V.object)).filter(Boolean),X=gn(H),Q=X,L="";if(a&&a!=="Change"){Q=X.filter(W=>W.class===a);let V=Du[a];if(!Q.length&&V){let W=X.filter(O=>O.class===V);W.length&&(Q=W,L=`, widened to ${V} subjects (no ${a} recorded)`)}}return{matches:Q,objMatch:l,candidates:u,traversal:`${P.join("+")} edges where subject = ${l.label}${L}`,ambiguous:d,matchedVia:f}}if(t.modifier==="transitive")return{matches:ur(e,l,{maxDepth:lb}).flat().map(P=>e.byId.get(P.id)).filter(Boolean),objMatch:l,candidates:u,ambiguous:d,matchedVia:f,traversal:`reverse dependency closure over imports+calls edges from ${l.label} (impactClosure, maxDepth=${lb})`};let g=br[i]||Mt(i).find(j=>pb.has(j))||null,b=!!(l.class&&Js.has(l.class));if(g&&(Js.has(a)||b)){let j=et(e,g).filter(L=>L.object===l.id),k=gn(j.map(L=>e.byId.get(L.subject)).filter(Boolean)),P=!a||a==="Change"?k:k.filter(L=>L.class===a),U="",H=Du[a];if(!P.length&&H){let L=k.filter(V=>V.class===H);L.length&&(P=L,U=`, widened to ${H} subjects (no ${a} recorded)`)}let X=(i==="touches"||i==="calls"||i==="uses")&&l.class==="Class"&&!et(e,"contains").some(L=>L.subject===l.id),Q=X?e.byId.get(wr(e,l)||""):null;if(P.length||!(X&&Q))return{matches:P,objMatch:l,candidates:u,traversal:`${g} edges where object = ${l.label}${U}`,ambiguous:d,matchedVia:f}}let y=l,$=u,E=d,_=f,v="",S=wb(e,i);if(S&&y.class&&y.class!==S){let j=zn(e,t.object,{expectedClass:S});if(j.match&&!j.ambiguous)y=j.match,$=j.candidates,E=j.ambiguous,_=j.matchedVia;else if(S==="Module"){let k=wr(e,y),P=k&&e.byId.get(k);if(P)v=`, refined from ${y.label} to its containing module`,y=P;else return{matches:[],objMatch:y,candidates:$,ambiguous:E,matchedVia:_,wrongGrainMiss:!0,wantClass:S,traversal:`"${t.object}" resolved to ${ks(y.class)} ${y.label} (grain mismatch: this "${i}" question needs a ${ks(S)}, and no containing module could be found to refine to)`}}else return{matches:[],objMatch:y,candidates:$,ambiguous:E,matchedVia:_,wrongGrainMiss:!0,wantClass:S,traversal:`"${t.object}" resolved to ${ks(y.class)} ${y.label} (grain mismatch: this "${i}" question needs a ${ks(S)})`}}let C=Mt(i).flatMap(j=>et(e,j)).filter(j=>j.object===y.id);i==="cochange"&&(C=C.concat(Mt(i).flatMap(j=>et(e,j)).filter(j=>j.subject===y.id).map(j=>({...j,subject:j.object,object:j.subject}))));let x="";if(!C.length&&y.class){let j=`ext:${String(y.label).toLowerCase()}`;C=Mt(i).flatMap(k=>et(e,k)).filter(k=>String(k.object).toLowerCase()===j),C.length&&(x=` (by name, via unresolved ${j} references)`)}let R=[],w=new Set;for(let j of C){let k=e.byId.get(j.subject);k&&!w.has(k.id)&&(w.add(k.id),R.push(k))}let T,I="";if(!a||a==="Change")T=R;else{let j=R.filter(P=>P.class===a),k=j.length||!Tb(i,a)?[]:_b(e,new Set([y.id]));if(j.length)T=j;else if(k.length)T=k,I=`, falling back to ${y.label}'s recorded source site (no defines edge)`;else if(a!=="Module"&&R.some(P=>P.class==="Module")){let P=new Set(R.filter(U=>U.class==="Module").map(U=>U.id));T=fd(e,P,a),I=`, then ${ks(a)} defined in the matched module(s)`}else T=[]}return{matches:T,objMatch:y,candidates:$,traversal:`${Mt(i).join("+")} edges where object = ${y.label}${x}${I}${v}`,ambiguous:E,matchedVia:_}}function Ao(e){if(e.class==="Module")return e.label;let t=(e.attributes||[]).find(s=>s.key==="site")?.value;if(t)return String(t).split(":")[0];let n=String(e.id||"").match(/^fn:(.+)#/);return n?n[1]:null}function Ju(e,t){let n=String(t||"").match(/^(.*):(\d+)(?:-(\d+))?$/);if(n){let o=n[3]&&n[3]!==n[2]?`lines ${n[2]}-${n[3]}`:`line ${n[2]}`;return`${Qu(e)} is defined in ${n[1]} at ${o}.`}let s=Ao(e);return s?`${Qu(e)} is defined in ${s} (no line span recorded in this index).`:null}function Qu(e){let t=String(e.label||e.id||"");return["Function","Method"].includes(e.class)?`function ${t}()`:t}function PT(e){let t=String(e.label||e.id||""),n=(e.attributes||[]).find(s=>s.key==="author")?.value;return n?`${t} (${n})`:t}function Fn(e){return e.length>1?`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`:e[0]}function hi(e){let t=e.object??e.subject??"?";return`${e.entityType?Ne(e.entityType,2)+" that ":""}${e.kind} "${t}"`}function Zu(e){return Jr[e]?.bare||e}function MT(e){let t=Zu(e);return t.endsWith("e")?`${t}d`:`${t}ed`}function FT(e){if(!Array.isArray(e.atoms)||e.atoms.length!==2)return null;let[t,n]=e.atoms;if(t.op!=="seed"||t.ast?.node!=="allOfClass"||n.op!=="difference")return null;let s=Ne(e.entityType,2);if(n.kind==="qual")return`${s} that are not ${n.filters.join(" and not ")}`;if(n.kind!=="set"||!n.ast)return null;if(n.ast.node==="existsEdge")return`${s} that do not ${Zu(n.ast.kind)} anything`;let o=n.ast.node==="clause"?n.ast.clause:n.ast;if(!o||o.node||!o.kind)return null;let r=o.object??o.subject;return r==null?null:`${s} that do not ${Zu(o.kind)} ${JSON.stringify(String(r))}`}function Ub(e){if(!e)return null;if(e.ambiguousParse)return{english:`ambiguous: ${e.candidates.map(hi).join(" \u2014 or \u2014 ")}`,machine:`ambiguousParse(${e.candidates.map(r=>Ub(r)?.machine).join(", ")})`};if(e.node)return{english:(e.node==="boolean"?FT(e):null)||`a compositional query (${e.node})`,machine:`composite(${e.node})`};let t=r=>JSON.stringify(String(r??"")),n=[];e.kind&&n.push(e.kind),e.negated&&n.push("negated"),e.entityType&&n.push(`entityType=${e.entityType}`),e.modifier&&e.modifier!=="direct"&&n.push(`modifier=${e.modifier}`),e.subject!=null&&n.push(`subject=${t(e.subject)}`),e.object!=null&&n.push(t(e.object));let s=`${e.shape}(${n.join(", ")})`,o;if(e.shape==="ask")o=`does "${e.subject}" ${e.negated?"not ":""}${ko(e.kind)} "${e.object}"?`;else if(e.shape==="meta")o=`what does "${e.object}" mean, in this graph's own vocabulary?`;else if(e.shape==="mentions")o=`where is "${e.object}" mentioned?`;else if(e.shape==="where")o=`where is "${e.object}" defined?`;else{let r=e.entityType?Ne(e.entityType,2)+" that ":"";o=e.shape==="forward"?`what "${e.object}" itself ${ko(e.kind)}`:`${r}${ko(e.kind)} "${e.object}"`}return{english:o,machine:s}}function Dn(e,t,n=null){let s=Bb(e,t,n);return t&&t.matchedVia==="fuzzy"&&t.objMatch&&!s.ambiguous&&(s.content=`assuming you meant ${t.objMatch.label}: ${s.content}`),s}function Bb(e,t,n){if(!e)return{content:`couldn't parse this as a graph question. Try: ${dd()}`,miss:!0,ambiguous:!1};if(e.node)return jT(e,t,n);if(e.ambiguousParse)return t.branches&&t.branches.length?{content:`this could mean more than one thing:
55
- ${t.branches.map((c,l)=>`${l+1}) as ${hi(c.parsed)}: ${c.rendered.content}`).join(`
53
+ `)}`+(o.length>ju?`
54
+ \u2026+${o.length-ju} more`:"")}var ku,Rh,zh,Ah,Dj,Uj,xu,Bj,Oa,Wj,Gj,Vj,Wh,Hj,qj,Kj,Yj,Xj,Jj,Qj,Zj,ek,tk,nk,sk,ok,rk,ik,ak,ck,lk,uk,dk,fk,pk,mk,hk,gk,Ch,bk,wk,Gh,Vh,Hh,yk,$k,vk,xk,Ek,Oh,Nh,kk,Lh,Ca,Ph,Mh,Fh,ii,He,_k,Tk,tg,Ak,nn,rg,Ck,hg,Ok,Nk,Lk,Pk,Mk,Fk,Dk,zk,Eu,Dh,Pa,Uk,Su,ju,De=M(()=>{qs();Dn();wu();si();ys();ku="This store holds no code index, so it records no modules or commits to look through.",Rh={"mgx:importsnamespace":"imports","mgx:callscoarse":"calls","seon:declaresmethod":"defines","mgx:testscoverage":"tests","mgx:touchedbycommit":"touches","seon:containscodeentity":"contains","seon:hassupertype":"inherits","mgx:changecoupledwith":"cochange","mgx:reexports":"reexports","mgx:serves":"serves","mgx:denotes":"denotes","mgx:touchessymbol":"touchesSymbol","mgx:callssymbol":"callsSymbol","seon:usescomplextype":"imports","seon:invokesmethod":"calls","seon:history":"touches","mgx:subclassof":"inherits","mg:imports":"imports","mg:calls":"calls","mg:defines":"defines","mg:tests":"tests","mg:touches":"touches","mgx:saidinsession":"saidInSession","mgx:inreplyto":"inReplyTo","mgx:statedby":"statedBy","mgx:canonicalisedfrom":"canonicalisedFrom"};zh=e=>/^(git|turn):/.test(String(e||""));Ah=30,Dj=8;Uj=2,xu=25,Bj=3;Oa=10,Wj=8,Gj=3,Vj=2,Wh=5,Hj=4,qj=.2,Kj=.35,Yj=.15,Xj=e=>/(^|\/)(examples?|fixtures?|samples?|demos?|benchmarks?|test-[^/]+)(\/|$)/.test(e),Jj=.2,Qj=.35,Zj=.2,ek=.35,tk=e=>/\.cs$/i.test(e),nk=e=>/^I[A-Z]/.test(String(e||"")),sk=.2,ok=.35,rk=50,ik=.2,ak=.35,ck=.5,lk=Wh,uk=3,dk=4,fk=1,pk=.9,mk=.5,hk=.2,gk=.35,Ch=4,bk=2,wk=[["imports"],["calls","callsSymbol"],["inherits"],["cochange"]],Gh=3,Vh=12,Hh=.9,yk=["imports","calls","callsSymbol","inherits"],$k=.5,vk=.6,xk=.2,Ek=.35;Oh=128,Nh=4,kk=64,Lh=250,Ca=class extends Error{};Ph=new WeakMap;Mh=40,Fh=40,ii=30;He=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value||"";_k=25,Tk=15;tg=40,Ak="tests edges are recorded module to module, so this is module-grain coverage.";nn=15;rg=new Set(["Function","Method"]);Ck=8;hg={function:"Function",class:"Class",method:"Method",attribute:"Attribute"};Ok=8,Nk=16,Lk=4,Pk=6,Mk=12,Fk=2,Dk=8,zk=3,Eu=e=>String(e||"").split(",").map(t=>t.trim()).filter(Boolean),Dh=e=>String(e||"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean),Pa=e=>{let t=String(e||"").trim();return t?t.split(",").map(n=>n.trim()).filter(Boolean).length:0},Uk=e=>{let t=new Map,n=e[0]??0,s=0;for(let o of e){let r=(t.get(o)||0)+1;t.set(o,r),r>s&&(s=r,n=o)}return n};Su=20;ju=40});function ot(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _g(e){let t=String(e||"");return xg&&(t=t.replace(xg," ")),t.replace(/\s+/g," ").trim()}function Tg(e){let t=String(e||"");t=t.replace(uR," ").replace(/\s+/g," ").trim();for(let n=0;n<3;n++){let s=t,o=t.match(rR);if(o&&(t=o[1].trim()),o=t.match(iR),o&&(t=o[1].trim()),o=t.match(Eg),o&&(t=o[1].trim()),o=t.match(Sg),o&&(t=o[1].trim()),o=t.match(jg),o&&(t=o[1].trim()),o=t.match(lR),o&&(t=o[1].trim()),o=t.match(kg),o&&(t=o[1].trim()),o=t.match(dR),o&&(t=o[1].trim()),o=t.match(fR),o&&Ys.test(o[1].trim())&&(t=o[1].trim()),o=t.match(pR),o&&Ys.test(o[1].trim())&&(t=o[1].trim()),o=t.match(mR),o&&Ys.test(o[1].trim())&&(t=o[1].trim()),o=t.match(hR),o&&Ys.test(o[1].trim())&&(t=o[1].trim()),o=t.match(gR),o&&Ys.test(o[1].trim())&&(t=o[1].trim()),o=t.match(bR),o&&Ys.test(o[1].trim())&&(t=o[1].trim()),o=t.match(wR),o&&(t=`what ${o[2].toLowerCase()} ${o[1].trim()}`),o=t.match(yR),o&&(t=`what does ${o[1].trim()} mean`),o=t.match($R),o&&(t=`what do you ${o[1].toLowerCase()} about ${o[2].trim()}`),o=t.match(vR),o){let r=o[1].trim();oR(r)||(t=!xR.test(r)&&(tR.test(r)||Ys.test(r))?r:`describe ${r}`)}if(o=t.match(ER),o){let r=o[1].trim();(Ys.test(r)||SR.test(r)||kg.test(r)||Eg.test(r)||jg.test(r)||Sg.test(r)||jR.test(r))&&(t=r)}if(t===s)break}return t}function PR(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t,o=t.match(NR);if(o&&(t=o[1].trim()),o=t.match(LR),o&&(t=o[1].trim()),t===s)break}return t}function FR(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t.match(MR);if(!s)break;let o=s[1].trim();if(!o||o===t)break;t=o}return t}function ci(e){let t=String(e||"").trim(),n=t.match(UR)||t.match(BR);return n?n[1].trim():null}function Nu(e){let t=String(e||""),n=t.match(zR);if(n){let o=Cg[n[1].toLowerCase()],r=Ag[n[2].toLowerCase()],i=n[5]||n[6],a=n[4]?n[4].toLowerCase():Iu[i.toLowerCase()];return`${o} ${r} ${n[3].trim()} and ${a}`}let s=ci(t);return s?`which modules transitively import ${s}`:t}function li(e){return String(e||"").replace(qk,t=>uu[t.toLowerCase()])}function jo(e){let t=li(e);return t=t.replace(Kk,n=>du[n.toLowerCase()]),t=t.replace(Yk,n=>fu[n.toLowerCase()]),t=t.replace(Xk,"with"),t=t.replace(Jk,(n,s)=>`${s} for`),t=t.replace(Qk,(n,s)=>`for ${s}`),t=t.replace(Zk,(n,s)=>s),t=t.replace(WR,"$1$2"),t=t.replace(Jm,"$1ing"),t=Tg(t),t=FR(t),t=PR(t),t=Nu(t),t=_g(t),t=pn(t),t=t.replace(/\?{2,}\s*$/,"?"),t.replace(/\s+/g," ").trim()}function ui(e){for(let t of[...Zm,...Qm]){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function Lu(e){for(let t of GR){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function Ng(e){let t=String(e||"").match(VR);if(!t)return null;let n=t[1].toLowerCase(),s=t[2].trim();return s?{entWord:n,predicate:s}:null}var Hk,qk,Rg,Kk,Yk,Xk,Jk,Qk,Zk,eR,xg,tR,Ys,nR,sR,oR,ai,rR,iR,aR,cR,Eg,Sg,jg,lR,uR,dR,fR,pR,mR,hR,gR,bR,wR,yR,$R,vR,xR,ER,SR,jR,kg,Fa,kR,RR,_R,TR,AR,CR,IR,UD,Ou,OR,BD,WD,GD,NR,LR,MR,Ag,Cg,DR,Iu,zR,Ig,Og,UR,BR,WR,GR,VR,dt,sn,ge,kn=M(()=>{Kn();Hk=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(ot).join("|")+")\\b","gi"),qk=Hk(uu),Rg=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(ot).join("|")+")\\b(?!\\.[a-z0-9])","gi"),Kk=Rg(du),Yk=Rg(fu),Xk=/(?<=^|\s)w\/(?=\s|$)/gi,Jk=/\b(thx|thanks|thank\s+you|many\s+thanks|ty|cheers)\s+4\b/gi,Qk=/\b4\s+(example|instance)\b(?!\s*[a-z])/gi,Zk=/\b(this|that)\s+(class|module|function|method|attribute|variable|file|commit)\b/gi,eR=Object.keys(me).sort((e,t)=>t.length-e.length).map(ot).join("|"),xg=Zr.length?new RegExp("\\b("+[...Zr].sort((e,t)=>t.length-e.length).map(ot).join("|")+")\\b\\s*,?","gi"):null;tR=new RegExp("\\b(?:"+Object.keys(me).sort((e,t)=>t.length-e.length).map(ot).join("|")+")\\b","i"),Ys=/^(?:which|what|who|whose|where|when|why|how)\b/i,nR=new Set(["modules","files","packages","functions","methods","classes","attributes","fields","properties","variables","globals","commits","changes","tests","members"]),sR=/^(?:all\s+|the\s+)?(?:module|file|package|function|method|class|attribute|field|property|variable|global|commit|change|test|member)\??$/i,oR=e=>{if(sR.test(e))return!0;let t=e.replace(/\?+\s*$/,"").trim().split(/\s+/);return nR.has((t[t.length-1]||"").toLowerCase())},ai="[,.;:!]|\u2014|\u2013|-",rR=/^(?:hi|hiya|hello|hey|yo|howdy|g'?day|yeah\s+nah|good\s+(?:morning|afternoon|evening|day)|greetings|salutations)(?:\s+(?:there|pardner|folks|friend|mate))?\s*[,.—–-]\s*(?:(?:just\s+a\s+)?quick\s+question\s*[,:—–-]?\s*)?(.+)$/i,iR=/^(?:thanks|thank\s+you|many\s+thanks|thx|ty|cheers)(?:\s+(?:so\s+much|a\s+lot|very\s+much|a\s+bunch))?\s*[,—–-]\s*(?:(?:just\s+a\s+)?quick\s+question\s*[,:—–-]?\s*)?(.+)$/i,aR="ok(?:ay)?|aight|cool|alright|sure|right|fine|great|nice|got it|gotcha|sounds good|no worries|no problem|another\\s+one",cR="(?:just\\s+)?(?:one|another)\\s+more",Eg=new RegExp(`^(?:(?:${aR})[\\s,]+|(?:${cR})\\s*(?:${ai})\\s*)+(.+)$`,"i"),Sg=/^(?:just\s+(?:poking\s+around|looking\s+around|browsing|exploring|checking\s+(?:this|it)\s+out)|first\s+time\s+(?:trying\s+this\s+out|using\s+this|here)|i'?m\s+new\s+(?:here|around\s+here|to\s+(?:this|all\s+this)(?:\s+(?:repo|codebase|project|app|tool|thing))?))\s*[,.—–-]\s*(.+)$/i,jg=/^(?:(?:maybe|possibly|perhaps)\s+)+(.+)$/i,lR=/^(?:please[\s,]+)+(.+)$/i,uR=/,?\s*if\s+(?:it'?s|it\s+is|that'?s|that\s+is)\s+not\s+too\s+much\s+(?:trouble|bother|hassle)\s*,?\s*/i,dR=/^(?:can|could|would|will)\s+you\s+(?:please\s+)?(.+?)(?:[,\s]+please)?\??$/i,fR=/^explain\s+(?:to\s+me\s+|please\s+)*(.+?)\??$/i,pR=/^tell\s+me\s+(?:please\s+)?(.+?)\??$/i,mR=/^(?:(?:would|do)\s+you\s+)?mind\s+telling\s+(?:me|us)\s+(?:please\s+)?(.+?)\??$/i,hR=/^do\s+you\s+know\s+(.+?)\??$/i,gR=/^i(?:'d|\s+would)?\s+(?:(?:like|want|need)\s+to|wanna)\s+know\s+(.+?)\??$/i,bR=/^i(?:\s+was|\s+am|'m)?\s+(?:just\s+)?(?:wonder(?:ing|ed)?|curious)(?:\s+(?:if|whether|about))?\s+(.+?)\??$/i,wR=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+(is|are)\??$/i,yR=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+means\??$/i,$R=/^what\s+you\s+(know|remember)\s+about\s+(.+?)\??$/i,vR=/^(?:show|give)\s+me\s+(?:the\s+)?(.+?)\??$/i,xR=/^everything\s+i(?:'d|\s+would)?\s+need\b/i,ER=/^(?:and|also|so|then|now|but)\s+(.+)$/i,SR=/^(?:does|do|did|is|are|was|were|has|have|had|can|could|will|would|should)\b/i,jR=/^(?:the|its|their|his|her|our|my)\s+[\w'-]+(?:\s+[\w'-]+){0,2}\s+(?:that|which|who)\s+\S/i,kg=/^(?:(?:actually|no\s+wait|wait|hold\s+on|never\s+mind|scratch\s+that|on\s+second\s+thought|i\s+mean(?:t)?)[\s,.]+)+(.+)$/i;Fa=e=>[...e].sort((t,n)=>n.length-t.length).map(ot).join("|"),kR=Object.freeze(["oh","ah","aha","ooh","ohh","wow","huh","hm","hmm","mm","mmm","heh","ha","yay","ugh","oof","phew","whoa","oops","yikes","oi"]),RR=Object.freeze(["nice","cool","great","neat","lovely","interesting","good","ok","okay","fair enough","makes sense","i see","got it","fine"]),_R=Object.freeze(["um","umm","uhm","uh","uhh","er","err","erm","ehm","eh","well","anyway","anyhow","anyways","regardless","moving on"]),TR=Object.freeze(["quick question","quick q","one quick question","just a quick question","random question","random thing","one more random thing","another random thing","one more thing","one last thing","last thing","one more question","side note","side question","sidebar","off topic","unrelated","on a different note","different topic","changing the subject","new topic","just curious","out of curiosity","curious","genuinely curious","while i'm here","while i have you","before i forget"]),AR=`(?:${Fa(kR)})(?:\\s+(?:${Fa(RR)}))?\\s*(?:${ai})\\s*`,CR=`(?:${Fa(_R)})\\s*(?:(?:${ai})\\s*|\\s+)`,IR=`(?:${Fa(TR)})\\s*(?:${ai})\\s*`,UD=new RegExp(`^(?:sorry\\s*(?:${ai})?\\s*)?(?:${AR}|${CR}|${IR})+`,"i"),Ou="what|who|which|where|when|why|how",OR="is|are|was|were|do|does|did|can|could|should|would|will|has|have|might|must",BD=new RegExp(`\\b(?:an?|the)?\\s*(?:${Ou})\\s*\\?\\s*$`,"i"),WD=new RegExp(`^(?:in|at|on|from|by|with|for|of|to|off)\\s+(?:${Ou})\\b`,"i"),GD=new RegExp(`\\b(?:${Ou})\\s+(?:i|you|he|she|it|we|they)?\\s*(?:${OR})\\b`,"i"),NR=/^(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+?,\s*(.+)$/i,LR=/^(.+?),\s*(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+$/i;MR=/^.+?(?:\s*(?:--|—|-)\s*)?\b(?:sorry|i\s+mean)\b\s*(?:--|—|-|,|:)\s*(.+)$/i;Ag=Object.freeze({imports:"importing",calls:"calling",touches:"touching",tests:"testing",exports:"exporting",contains:"containing",defines:"defining",uses:"using","inherits from":"inheriting from"}),Cg=Object.freeze({module:"modules",class:"classes",function:"functions",method:"methods",attribute:"attributes",variable:"variables",commit:"commits",file:"files"}),DR="public|private|protected|static|abstract|constant|re-?exported|exported|tested|covered|untested|uncovered",Iu=Object.freeze({tests:"tested","a test":"tested","any tests":"tested",coverage:"covered","test coverage":"covered"}),zR=new RegExp("^if\\s+(?:a|an|the)?\\s*("+Object.keys(Cg).join("|")+")\\s+("+Object.keys(Ag).join("|")+")\\s+(.+?),\\s*(?:(?:is|are)\\s+(?:it|that|they|this)\\s+("+DR+")|(?:has|have)\\s+(?:it|that|they|this)\\s+got\\s+("+Object.keys(Iu).join("|")+")|(?:does|do)\\s+(?:it|that|they|this)\\s+have\\s+("+Object.keys(Iu).join("|")+"))\\??$","i"),Ig="(?:were|was)\\s+(?:deleted|removed)",Og="what\\s+(?:would|might|could)\\s+(?:break|fail|be\\s+affected)",UR=new RegExp("^if\\s+(.+?)\\s+"+Ig+",?\\s*"+Og+"\\??$","i"),BR=new RegExp("^"+Og+"\\s+if\\s+(.+?)\\s+"+Ig+"\\??$","i");WR=new RegExp(`^(where\\s+(?:is|are|was|were)\\s+.+?)\\s+(?:${cu.map(ot).join("|")})(\\s*[?.!]*)$`,"i");GR=Object.freeze([{re:/^what\s+(?:functions?|methods?|members?|attributes?|fields?|properties)\s+(?:are|is)\s+(?:in|inside|within)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+(?:functions?|methods?|members?|attributes?|fields?|properties)\s+(?:does|do)\s+(.+?)\s+have\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+are\s+(?:the\s+)?(?:functions?|methods?|members?|attributes?|fields?|properties)\s+(?:of|in|inside|within)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^(?:the\s+)?(?:members?|methods?|attributes?|contents)\s+of\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+is\s+(?:in|inside)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+else\s+is\s+(?:in|inside)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+(?:defined|declared)\s+(?:the\s+)?(?:function\s+|method\s+|class\s+|module\s+|variable\s+|constant\s+)?(.+?)\??$/i,to:e=>`where is ${e[1]} defined`},{re:/^where'?s\s+(?:the\s+)?(.+?)\s+(defined|declared|located|implemented)\??$/i,to:e=>`where is ${e[1]} ${e[2]}`},{re:/^were\s+is\s+(?:the\s+)?(.+?)\s+(defined|declared|located|implemented)\??$/i,to:e=>`where is ${e[1]} ${e[2]}`},{re:/^what\s+is\s+the\s+purpose\s+of\s+(?:the\s+)?(?!(?:an?|it|this|that|these|those)\s)(.+?)\??$/i,to:e=>`what is a ${e[1]}`},{re:new RegExp(`^what\\s+does\\s+(?:the\\s+)?(?!(?:an?|it|this|that|these|those)\\s)(.+?)\\s+do\\s+(?:${lu.map(ot).join("|")})\\??$`,"i"),to:e=>`what is a ${e[1]}`},{re:/^(?:which|what)\s+(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+(?:are|is)\s+(public|private|protected|static|abstract|constant|exported|re-?exported|tested|covered|untested|uncovered)\??$/i,to:e=>`${e[2].toLowerCase()} ${e[1].toLowerCase()}`},{re:/^what\s+(?:is|are)\s+(not\s+)?(tested|untested|covered|uncovered)\??$/i,to:e=>{let t=e[2].toLowerCase();return`${e[1]?t==="tested"?"untested":t==="covered"?"uncovered":t:t} modules`}},{re:/^what\s+does\s+(.+?)\s+changes?\s+together\s+with\??$/i,to:e=>`what co-changes with ${e[1]}`},{re:/^what\s+changes?\s+together\s+with\s+(.+?)\??$/i,to:e=>`what co-changes with ${e[1]}`},{re:/^how\s+many\s+commits\s+(?:are|were)\s+(?:recorded|logged)\s+(?:for|against)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`how many commits touched ${e[1]}`},{re:/^who\s+(?:wrote|authored)\s+(?:the\s+)?(?!(?:commit\s+)?[0-9a-f]{7,40}\??$)(.+?)\??$/i,to:e=>`who touched ${e[1]}`},{re:/^who\s+is\s+the\s+authors?\s+of\s+(?:the\s+)?(?!(?:commit\s+)?[0-9a-f]{7,40}\??$)(.+?)\??$/i,to:e=>`who touched ${e[1]}`},{re:/^(?:does|do)\s+(?!.*\bnot\b)(.+?)\s+have\s+(?:any\s+)?(?:tests?|test\s+coverage|coverage)\??$/i,to:e=>`what tests ${e[1]}`},{re:/^(?:is|are)\s+(?!.*\bnot\b)(.+?)\s+tested\??$/i,to:e=>`what tests ${e[1]}`},{re:/^what\s+needs\s+(?:to\s+be\s+)?(?:a\s+)?(?:tested|tests?|testing|coverage|covering)\??$/i,to:()=>"untested modules"},{re:/^(?:which|what|list|show(?:\s+me)?|find)?\s*(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+(?:(?:that|which)\s+)?(?:have|has|having|with)\s+no\s+tests?\??$/i,to:e=>`untested ${e[1].toLowerCase()}`},{re:/^(?:which|what|list|show(?:\s+me)?|find)?\s*(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+without\s+(?:any\s+)?tests?\??$/i,to:e=>`untested ${e[1].toLowerCase()}`},{re:new RegExp(`^(?:do|does)\\s+(.+?)\\s+(${eR})\\s+(?:anything|something)(?:\\s+else)?\\??$`,"i"),to:e=>`what does ${e[1]} ${e[2]}`}]);VR=new RegExp("^(?:which|what|who|list|show(?:\\s+me)?|find|give\\s+me)?\\s*(?:the\\s+|all\\s+)?([a-z][a-z-]*)\\s+(?:(?:that|which|who)\\s+)?(?:(?:do|does|did|are|is|was|were|have|has|can|could|will|would|should)\\s+not|cannot|can't|won't|couldn't|shouldn't|wouldn't|not)\\s+(.+)$","i");dt=new Set(["what","who","which","where","when","why","how","does","do","did","is","are","was","were","the","a","an","of","to","from","at","in","on","there","something","anything","nothing","one","any","anywhere","last","usually","typically","generally","normally","often","commonly","mostly","should","would","could","can","will","shall","might","must"]),sn=e=>String(e).replace(/\?+\s*$/,"").replace(/,/g," ").split(/\s+/).filter(Boolean),ge=e=>e.flatMap(t=>String(t).toLowerCase().split(" "))});var Pg,Lg=M(()=>{Pg={source:"corpus/wordnet/*.jsonl lemmas, expanded through the regular -s/-ed/-ing inflections",generator:"scripts/generate-real-word-collisions.mjs",targets:["alongside","build","builds","built","call","calling","calls","change","changed","changes","check","checks","class","co-change","co-changes","code","commits","contain","containing","contains","couple","couples","cover","covers","declare","declares","define","defined","defines","defining","denote","denotes","denoting","depends","derive","derives","directly","edited","execute","executes","exercise","exercises","explicitly","export","exporting","exports","expose","exposes","extend","extending","extends","fire","fires","from","grab","grabs","have","hits","hold","holds","hooked","import","importing","imports","included","indirectly","inherit","inheriting","inherits","inside","into","invoke","invokes","kick","kicks","kind","land","landed","lean","leans","live","lives","make","makes","modified","modifies","move","moves","parent","part","pass","passes","pull","pulls","re-export","re-exports","reference","references","relies","rely","require","requires","runs","serve","serves","serving","share","shares","sits","subclass","subclasses","subclassing","superclass","superclasses","sure","talk","talks","tend","tends","test","testing","tests","through","together","touch","touched","touches","touching","transitively","trigger","triggers","tweaked","updated","uses","using","usually","verifies","verify","went","were","wired","with"],words:["aalging","aasing","aave","ablies","abling","aboves","absing","abuses","abusing","acauling","achinged","acolds","acquire","acquires","acyling","adelies","adenine","adenined","adenines","adenining","adenota","adenotaing","adenotas","aditted","aerides","aerified","aerifies","aerify","aerying","affine","affined","affines","affining","afire","afires","afling","agalling","ailing","aired","airied","airies","airport","airporting","airports","airsed","airses","airted","alaing","alases","albing","alecks","aleves","aliaes","alikes","alines","alive","alives","allaing","allies","alling","alls","allying","alongsided","alongsides","alping","alting","altogether","amasses","amazes","amends","amorting","amorts","amuses","amusing","analling","anded","anoded","ansing","anuses","apart","aparts","apises","apparent","appends","appose","apposes","apsing","apsises","arab","arabis","arabs","ardent","argent","arpent","arrive","arrives","arsing","asaing","asding","aseans","ases","ashing","ashore","ashores","asing","asking","asping","asring","asses","assess","assets","assing","assure","attending","attest","attesting","attests","audited","aufing","auging","auking","aurifies","aurify","avouch","avouched","avouches","avouching","awaked","awakes","awared","awares","awling","awried","axling","baases","badded","bailed","bailing","baited","bake","bakeds","bakers","bakes","balded","balding","baling","balk","balking","balks","ball","balling","balls","ballsing","ballying","balming","band","banded","bandeds","bandied","bandsed","banked","banned","barded","barelies","barely","barses","bart","baseses","bashes","basing","basises","bass","bassed","basses","basset","bassets","bassos","bastes","basting","batses","bauded","baulks","bawded","bawling","bbsing","beaked","bean","beanos","beans","beasting","beasts","beating","beeting","begild","begilds","behave","behold","beholds","belied","belief","beliefs","belies","belikes","belizes","belles","bellies","belling","belting","bend","bended","bends","bent","berging","bering","berking","berming","beroes","besets","besots","besses","bessing","best","besting","bests","beting","betting","bevies","bhanged","biered","bigger","biggers","billing","bind","binded","birded","birled","birles","biroed","birred","bising","bjsing","bladed","blanced","bland","blanda","blandaed","blanded","blands","blanked","blares","blases","blasts","bleaked","bleaks","blears","bleats","blended","blends","blesting","blests","blinded","blinds","blited","blites","bloked","blonded","bmuses","bnsing","boched","boches","boching","bocked","bode","bodilied","bodilies","boiled","boileds","bokked","bold","bolds","bolling","bonded","boners","bonked","boobed","booked","bookeds","bookend","booker","bookied","booksed","boomed","booned","boored","booted","boozed","borers","borough","bosked","bosses","botched","botches","botching","boucheed","bouchees","boucle","boucled","boucling","boughed","boughing","boules","boulle","boulles","bouses","bousing","bowers","boxers","bpsing","bragger","braggers","brakes","branded","brasses","breaked","breves","breving","bricks","brigged","brills","broked","brooked","bruins","brunts","brunus","bses","bsing","bugled","bugles","buhled","builders","buildups","bull","bulled","bullet","bulling","bulls","buns","bunses","bunsing","buried","burieds","burled","burleds","buses","bushes","bushing","busied","busies","busking","bussing","busying","buyied","buying","bypass","bypasses","caballing","cabals","cabbing","cabers","cabged","cabging","cables","cablin","cabling","cablins","caching","cackling","cadded","cadding","cadent","cadged","cadges","cadging","cadring","cafers","caffing","cafing","cagers","caging","cagying","caining","cajoling","cake","cakes","cakiling","caking","calcine","calean","caleans","caleying","caleys","calf","calfing","calfs","califs","calkin","calking","calkins","callaing","callas","callers","callinged","callings","callous","callowing","callows","calluna","callus","calm","calming","calmings","calmlying","calms","calquing","calvaing","calvas","calves","calving","calvings","calx","calxes","calxing","calycling","calyxing","camass","camelling","camels","camming","camoing","camping","canaing","canalling","canals","candid","candied","candled","candling","cangue","cangued","cangues","caning","canning","canoes","canting","cantling","capers","caping","caplin","caplins","capoing","capping","captain","captaining","captains","carded","carding","caring","carking","carlina","carline","carling","carlings","carlos","carning","caroling","carolling","carols","carping","carring","cart","carting","carver","carvers","carves","casaing","cashes","cashing","casking","cassies","castes","castling","casually","casuses","caters","catling","catlings","catses","catsing","catting","cattling","caul","cauline","cauling","caulking","cauls","cavaing","cave","caverns","cavilling","cavils","caving","cavying","cawing","caying","ceases","cecalling","cede","cedied","ceiling","cell","celling","celloing","cellos","cells","cellsing","cent","cercises","cere","cering","cerise","cerises","ceroing","cerring","certain","certaining","certains","certifies","certify","cervina","cervus","cfling","cgsing","chadded","chafed","chaffed","chafinged","chagaed","chagas","chagga","chaggaed","chaggas","chained","chainsed","chainses","chaired","chaise","chaised","chaises","chaited","chaits","chajaed","chalked","chalking","challis","champed","chanal","chanals","chanar","chanars","chance","chanced","chancels","chances","chancied","chancies","chancre","chancred","chancres","chancy","changers","channels","chanted","chanters","chanteys","chantied","chanties","chanty","chaosed","chaoses","chappe","chapped","chappes","charded","chards","charge","charged","chargers","charges","charied","charmed","charms","charred","charrs","charted","charts","chased","chasmed","chasms","chassed","chaste","chasted","chastes","chatted","chaunaed","chaused","chauses","chawed","cheaps","cheats","checkeds","checkers","checksum","checkups","cheek","cheeks","cheeps","chelas","chenned","cheops","cherts","chesting","chewas","chianed","chick","chicks","chigger","chiggers","chiling","chilling","chills","chinaed","chined","chines","chinked","chinks","chinned","chinoed","chirks","chits","chives","choanaed","chock","chocked","chocks","choked","choker","chokers","choler","cholers","chonned","choosed","chords","chores","chough","chuaned","chuck","chucks","chugged","chunga","chungaed","chungas","chunked","chunks","chyling","cialis","cicers","ciders","circed","circes","cive","cives","civies","cladded","claded","clades","clading","clads","claims","clamps","clams","clamses","clanged","clangers","clanks","clans","claps","clarks","claros","clash","clashes","clasp","clasps","classed","classic","classy","clast","clasts","clausa","clausas","clause","clauses","claver","clavers","clavus","clawing","claws","claying","clays","clean","cleans","cleanse","clerks","clever","clevers","cliing","climes","clinged","cloaks","clocks","closer","closers","closes","cloved","cloven","clovens","clover","clovers","clucks","cluing","clving","clxing","cnsing","coached","coaches","coaching","coaling","coasts","coaxer","coaxers","cobber","cobbers","cobble","cobbles","cocain","cocaining","cocains","cocked","cocker","cockers","cockle","cockles","coda","codaed","codded","coddles","coded","coders","codes","codex","codgers","codified","codifies","codling","cods","coed","coeurs","coffer","coffers","coggle","coggles","coheres","coiling","coiner","coiners","coired","coke","colaing","cold","colded","colding","colds","cole","coleus","coliing","coling","colling","collins","collying","colors","coltan","coltanning","coltans","colter","colters","colting","comalling","combats","comber","combers","come","comer","comers","comfies","comfit","comfits","comics","comints","comity","commas","comments","commes","commie","commied","commies","comming","commit","commix","commixes","commons","commute","commutes","compel","compels","compile","compiles","complies","comply","comport","comporting","comports","conched","conches","conching","concluded","cone","coneys","confer","confers","confining","confits","conged","conger","congers","conges","conjoin","conjoining","conjoins","conked","conker","conkers","constrain","constraining","constrains","contact","contacting","contacts","contadinoing","contadinos","contagion","contagioning","contagions","containeds","containers","contemn","contemning","contemns","continuing","contrail","contrailing","contrails","contriting","contriving","converse","converso","converts","convex","convey","conveys","convoke","convokes","cooked","cookeds","cookers","cookied","cooled","cooler","coolers","cooling","cooned","cooped","cooper","coopers","cooted","cooter","cooters","copalling","cope","copeck","copecks","copier","copiers","copies","copper","coppers","copses","copula","copulas","coralling","corded","core","coreference","coreferences","corer","corers","corked","corker","corkers","corner","corners","corpse","corpses","corvee","corvees","cosecs","cosher","coshers","cosmics","cosmids","cosses","costing","cotanning","cotans","cote","cotter","cotters","couch","couched","couches","couching","coude","couded","coue","coughed","coughing","coupe","coupes","coupleds","couplers","couplets","coupon","coupons","course","courses","couthed","couthing","coved","coven","covens","covereds","coverts","covet","covets","covey","coveys","cower","cowers","cowling","cowpie","cowpies","cozens","cpsing","crab","crabs","cracks","cradling","cragged","crakes","craned","cranes","cranked","cranned","crass","crasses","crawling","crawls","creaked","creaks","credited","creeks","cresting","crests","criers","cringe","cringed","cringes","crocks","crooked","crouch","crouched","crouches","crouching","croupe","croupes","crumple","crumples","cruses","crusing","cses","csing","ctened","ctenes","cubing","cuking","culling","culming","culting","cupalling","cupels","cupsing","cupule","cupules","cure","curing","curling","curses","cursing","curtain","curtaining","curtains","curves","curving","cusking","cusping","cussing","cuting","cutlass","cutses","cutsing","cxling","cxlving","cyanned","cyanoed","cycling","cyders","cymling","cysting","dadded","dahling","dailing","daises","daling","dall","dalliing","dalling","dallis","dalls","dallying","daloing","danced","dander","dandied","dandled","danked","dansed","danses","darded","darling","dart","dashes","dassed","dassies","dative","datives","dayses","ddsing","deafened","deafening","deafing","deaing","dealting","dean","deaned","deaning","deans","dearie","dearies","debate","debates","debating","debiled","debiling","deboned","debrises","debted","decade","decades","decalling","decease","deceases","deceive","deceives","decents","decided","deciding","deciled","deciling","declaim","declaims","declareds","declarers","declaw","declined","declining","decocting","decodes","decoding","decoing","decoke","decokes","decoking","decouple","decouples","decoying","decries","deepens","deface","defaced","defaces","defacing","defame","defamed","defames","defaming","defang","defanged","defanging","defangs","defence","defenced","defences","defencing","defended","defending","defends","defensed","defenses","defensing","deference","deferences","deferenses","defiance","defianced","defiances","defiancing","defiant","defianted","defianting","defiants","defied","defies","defile","defiled","defilers","defiles","defiling","defininged","definings","definited","definites","definiting","deflate","deflates","deftness","defuse","defused","defuses","defusing","deglaze","deglazes","deicing","deified","deifying","deigned","deigning","deisted","deists","deitied","delete","deletes","deleting","delfing","delfting","deliing","delivers","delling","delving","demands","demised","demising","demode","demodes","demoding","demoing","demote","demotes","demoting","dengue","dengues","denguing","denied","denned","denotives","denotiving","densaing","denses","densing","dent","dentate","dentates","dentating","dente","denteds","dentes","dentin","dentined","dentines","denting","dentining","dentins","denude","denudes","denuding","denying","depart","depend","depended","deplane","deplanes","deplore","deplores","deponed","deposing","depotting","deprave","depraves","deprive","depriveds","deprives","depute","deputes","deputing","derating","derbies","deride","derides","deriding","derisive","derisives","deriveds","dermises","derpies","derping","derring","derrises","derving","descends","deserve","deserves","deserving","designed","designing","desired","desiring","desking","desponds","dessing","destined","destines","destining","destiny","detained","detaining","detents","detest","detesting","detests","detinue","detinued","detinues","detinuing","detoxes","detoxing","deuses","deusing","deveined","deveining","deviced","devicing","deviled","devised","devising","devote","devoteds","devotees","devotes","devoting","devouting","dewied","dewiness","dewing","dexoned","dhalling","dholed","dholes","dick","dicks","dieted","digger","diggers","dilling","dining","dinted","dinting","dire","direct","directed","director","directory","directs","dired","dires","dirged","dirges","dirked","disport","disporting","disports","disses","ditaed","ditted","dive","dives","divest","divine","divined","divines","divining","dmuses","docked","doleds","dolling","domine","domined","domines","domining","donate","donates","donating","doobed","doomed","doored","dopeds","dories","dorked","dosing","dosses","doting","double","doubles","douched","douches","douching","doughed","doughing","douses","dousing","dove","doves","dowers","dozers","drab","drabas","drabs","dragger","draggers","drained","draining","drakes","dranged","drecks","drilies","drive","drivels","drivens","drivers","drives","drover","drovers","drunks","druses","drusing","drylies","dses","dsing","dsling","dtsing","ducing","duding","dudses","dudsing","duking","dulies","dull","dulling","dulls","dulses","dulsing","duning","duns","duoing","duping","duples","during","dusking","eagling","earling","earses","easies","easing","easted","easting","eating","eatses","ebitted","ebooked","ebsing","ebving","echted","eclats","ecting","eddaed","eddied","eddoed","edgied","edibled","edicted","editeds","editor","editted","edsing","edtaed","educed","eduled","eelses","eerilies","eerily","eerying","effort","efforting","efforts","efting","egesting","egests","eidoses","eiraed","elan","eland","elanded","elanned","elans","elanus","elated","elegans","elided","elinted","elited","elling","elocute","elocutes","elopses","elsing","eluted","elvers","emending","emiled","emitted","emoted","emoting","emsing","enated","enates","enating","encode","endived","ends","energise","energises","enquire","enquires","ensile","ensure","entendring","ententing","epopses","eposes","equally","equine","equines","eraing","erectly","erging","erning","eroses","erring","ersted","ersting","erudited","erying","escort","escorting","escorts","eses","esing","esports","esportsing","espouse","espouses","esquire","esquires","esting","ests","eternise","eternises","ethoses","evicted","evoked","evokes","exceed","exceeding","exceeds","exchange","exchanged","exchanges","excite","excited","excites","excluded","execrate","execrates","executeds","executive","executives","executors","exegete","exegetes","exercisers","exerciseses","exerting","exerts","exhort","exhorting","exhorts","exiled","existed","exitted","exodes","exorcise","exorcisers","exorcises","exorcism","exorcisms","exorcist","exorcists","exorcize","exorcizes","expand","expanding","expands","expanse","expanses","expats","expatting","expect","expecting","expects","expend","expending","expendings","expends","expense","expenses","expensing","expert","experting","expertise","expertises","experts","expiating","expiring","expiry","expirying","explicit","explicits","explode","explodes","exploit","exploiting","exploits","exploring","expoing","exporters","exportinged","exportings","expos","exposeds","exposing","exposure","exposures","express","exsert","exserting","exserts","extant","extanting","extants","extendeds","extent","extented","extenting","extents","extern","externa","externaing","externas","externed","externing","externus","extort","extorting","extorts","extruding","fabling","fadded","failing","failling","faire","faires","fairies","faited","fake","fakers","fakes","fall","falling","fallings","falls","fallsing","falses","falsing","fanned","farces","fare","fares","fart","fasces","fassed","fasting","fawkes","fcsing","feasting","feasts","feating","fecalling","feeting","feined","feining","feisting","feists","felids","feline","felined","felining","felises","fellies","felling","felting","fend","fended","fends","feres","ferined","fering","ferining","ferning","ferring","fesses","fessing","feting","fetting","fevers","fibers","fibre","fibres","fice","fices","fide","fides","fiends","fierce","fierces","fieries","fieris","fife","fifes","figure","figures","file","filers","files","filets","filles","filling","filses","find","finded","fine","finers","fines","fining","fiords","fireds","firm","firmas","firmers","firms","firmus","firsts","firths","fishes","fisting","fitses","fixe","fixeds","fixers","fixes","fizzes","flakes","flange","flanges","flanked","flanned","flasks","flecks","flicks","fliers","flirts","focalling","fold","folds","folies","folked","fonded","fooded","fooled","footed","forces","fore","fores","forest","forges","forked","form","fortes","fosses","fountain","fountaining","fountains","foyers","fpsing","freaked","frieds","friers","fries","frigged","frog","froms","frores","fros","frsing","fsbing","fshing","full","fulling","fulls","fuming","funded","funs","furies","furzes","fuseds","fusees","fusels","fuses","fusing","fussing","fuzing","fwsing","gabling","gabs","gadded","gaeling","gaited","galaing","galing","gall","galliing","gallina","galling","gallings","gallis","galls","gallus","gand","ganded","gander","gandied","ganked","gaoling","garb","garbs","garded","garment","garnet","gaseses","gashes","gassed","gassies","gatling","gauched","gauches","gauching","gauded","gauling","gausses","gcsing","gean","geans","gelids","gellies","gelling","gelting","genies","genome","genomes","genoming","gent","germing","gerres","gestaing","gestes","gesting","getting","gilling","girded","girled","giroed","gisting","give","givens","gives","gladded","gladed","glanced","gland","glanded","glands","glandsed","glansed","glares","glass","glasses","glassy","gleams","glean","gleans","glides","glises","gofers","gold","golds","gonded","goners","gooded","goofed","gooked","gooned","gooped","goosed","gorals","gouached","gouaches","gouaching","governs","gpsing","graces","grad","grades","grads","graf","grafs","grafts","grails","grains","gram","gramas","gramps","grams","gran","granded","grands","grange","granged","granges","grans","grants","grapes","graphs","grases","grasps","grass","grasses","grassy","gratas","grates","gratis","graves","gravis","gray","grays","grazes","greats","grebes","greylies","greyly","groaks","groans","groats","grouch","grouched","grouches","grouching","groves","grub","grubs","grunts","gruses","gsaing","gsring","guesting","guests","guiing","guild","guilds","guiled","guiles","guilt","guilty","guises","guising","gull","gulling","gulls","guns","guses","gushes","gushing","gussing","gutses","gutsing","guying","gyrans","habits","hacked","hadded","hagged","haicks","haiked","hailing","haired","haje","hakeas","hakes","halals","hale","halfing","haling","hall","halling","halls","halming","haloing","halting","halve","halved","halves","halving","hame","hand","handed","handeds","handel","hander","handied","handled","handsed","hanged","hangers","harded","harems","hares","harked","harold","harolds","hart","harvey","hashes","hassles","hastes","hasting","hate","hats","hauling","haved","haven","havens","haves","hawked","hawses","haze","heating","heave","heaved","heaven","heaver","heaving","hectare","hectares","hefting","heired","heisting","held","helds","helixes","helling","helving","herbes","herbing","herding","here","hering","herming","heroing","herpes","herring","hets","hetting","hexine","hexined","hexines","hexining","hexose","hexoses","hhsing","hiatus","hick","hicked","hicks","hies","hilling","hilts","hind","hinded","hinged","hinges","hins","hints","hips","hire","hired","hirers","hires","hirtas","hiss","hisses","hives","hivs","hoards","hoared","hoaxed","hobbed","hoboed","hocced","hocked","hockey","hodded","hods","hoed","hogged","hoists","hokaed","holcus","holders","holdups","hole","holed","holes","holeys","holism","hollas","hollos","holm","holms","holy","homers","homied","homoed","honied","honked","honker","honkey","honkied","honored","hooches","hooching","hood","hooded","hoodeds","hoods","hooeyed","hoofed","hoofeds","hoofer","hookah","hookeds","hooker","hookeri","hookers","hookied","hookies","hooksed","hookses","hookup","hooped","hoopoed","hoopsed","hooted","hooter","hooved","hooveds","hoovers","hopers","hopied","hopped","hopple","hopples","hopsed","horded","hordes","horned","horsed","hosing","hosted","hosting","hotbed","hots","hotsed","hotted","hounds","houred","housed","houses","housing","hover","hovers","hoyaed","hrts","hses","hsing","hucked","huging","hulked","hull","hulling","hullos","hulls","hunged","hunked","huns","huoned","hushes","hushing","husked","husking","husoing","huts","hyoids","ictalling","idioted","idlies","iising","ileals","illing","images","impact","impacting","impacts","impart","imparting","impartings","imparts","impasses","impends","implore","implores","imploring","impoliting","important","importeds","importeeing","importees","importers","importinged","importings","importune","importuning","imposing","impost","imposting","imposts","improving","impure","impures","impuring","imputing","inbuilt","incise","incite","inclined","inclosed","include","includeds","includes","income","incomes","indied","indirect","indirected","indirects","indite","indited","indole","indoles","inerting","inerts","inference","inferences","infidel","influxed","info","inhabit","inhabits","inhere","inhered","inherent","inherenting","inherents","inheriteds","inheritinged","inheritings","inheritors","inheritting","inhibit","inhibits","initio","inkied","inland","inlanded","inline","inosine","inquire","inquires","insane","insert","inserting","inserts","insided","insider","insiders","insides","insist","insoles","inspire","insted","insting","intake","intakes","intending","interim","interims","intermit","intermits","inti","intied","intoed","intones","intos","intro","intron","intros","intruded","invades","invert","inverting","inverts","invites","invoice","invoices","involve","involves","iodide","ipsing","ired","ires","ironside","irsing","iruses","ises","isiing","ising","island","islanded","isling","isming","isning","isring","itsing","iuding","jailing","jakes","janned","jawses","jean","jeans","jellies","jelling","jerking","jest","jesting","jestings","jests","jetting","jigger","jiggers","jirded","jive","jives","jocked","jokers","jooked","josing","josses","joules","jove","joves","juking","julies","juning","jure","juring","juses","jussing","justes","juting","kailing","kakkes","kalaing","kaliing","kaling","kalkas","karens","karling","kelpies","kelting","kenoing","kepting","keraing","kerbing","kerite","kerited","kerites","kerning","kerring","keynote","keynotes","keynoting","khanned","kianged","kickers","kied","killing","kilned","kina","kinaed","kinda","kindas","kindle","kindly","kinds","kine","kined","king","kinged","kinked","kinks","kinned","kino","kinoed","kins","kiosks","kirk","kirked","kirks","kisses","kith","kleins","klick","klicks","knacks","knocks","knucks","koined","kooked","kookied","kuiing","kvasses","kweeked","kylies","labbed","lacced","lacied","lacked","ladded","ladder","laddied","laded","ladied","ladled","ladling","laed","lagans","lagend","lagended","lagged","lahhed","lahued","laiced","laid","laided","lairded","lake","lakes","lakhed","lallying","lamaed","lambed","lament","lammed","lamnaed","lamped","lanaied","lanated","lanced","lancer","lances","lancet","landaued","landeds","lander","landers","landler","lands","lane","lang","langed","langued","lank","lankaed","lanked","lankied","lanned","lansaed","lanseh","lanset","lapped","lapsed","lapses","lard","larded","larder","larged","laried","larked","larred","lashed","lashes","lassas","lasses","lassies","lassos","lasted","lasting","latent","latest","latesting","latests","lathed","latked","latkes","latsed","latses","latted","lauans","laud","lauded","lauder","laudes","launced","launder","lavaed","laves","lavved","lawsed","lawses","laxaed","lazied","lead","leaded","leaden","leadens","leads","leaf","leafs","leak","leaked","leaks","leal","leals","leaners","leap","leaps","learn","learns","leases","leasting","leaven","leavens","leaving","ledded","lefting","legals","legends","lemnas","lemons","lended","lender","lends","lenifies","lenify","lens","lensed","lent","lented","lentes","lentoing","leon","leones","leons","lerring","lesses","lessing","letting","levants","levees","levels","levited","levving","lewded","lianaed","lianas","liared","libels","libred","lice","lices","lick","licks","lidded","lieded","lieges","lies","life","lifers","lifes","ligand","liganded","ligans","ligers","lignes","like","likeds","likens","likes","limans","lime","limens","limes","limeys","linden","lindied","line","lineds","linens","liners","lines","linged","linied","linked","linoed","linted","liraed","lirred","lises","lisles","listes","listing","lite","liters","lites","lithes","litred","livedos","livens","livers","livias","livids","llanoed","llanos","loached","loaches","loaching","loaded","loan","loans","localling","loched","loches","loching","locked","lode","lohans","loired","lolling","loners","longed","looked","looker","looksed","loomed","looned","looped","loosed","looted","lorded","losers","losing","losses","losting","louched","louches","louching","louded","loughed","loughing","loupes","louses","lousing","louver","louvers","lover","lovers","lowans","lowers","lsding","lubing","lueses","luesing","luging","lull","lulling","lulls","lunaed","lundaed","lunged","lunned","luoing","lure","luring","lushes","lushing","luting","luxing","lynxed","mace","macers","maces","maches","mackems","mackle","mackles","madake","madakes","madded","made","mades","maes","magens","mahoes","maided","mailing","maines","maired","maizes","makers","makeups","mako","makos","male","maleos","males","maliing","maliks","maling","mall","malling","malls","malsing","malting","mameys","mandaed","manded","mane","maneds","manes","manied","manies","mankies","manned","mansed","manxed","manxes","maples","mapling","mare","mares","marges","maries","markeds","markers","markets","marling","mart","martes","masers","mases","maskeds","maskers","mass","massed","masseds","masses","masting","mate","mateds","maters","mates","mateys","mattes","mauling","maunded","maxes","maybes","maze","mazeds","mazers","mazes","mazies","mealies","mean","means","meating","mediaed","mediated","medicied","meeting","meined","meining","melees","melias","melics","melting","mend","mended","mends","menoing","mere","merelies","merely","merges","merging","mering","merited","merles","merling","merring","merses","mersing","mesaing","meshing","mesning","messes","messing","meting","metrifies","metrify","mevving","mick","micks","mike","mikes","milling","mind","minded","minified","minifies","minkes","mire","mired","mires","miried","miries","miroed","mising","misses","misting","mitred","mitres","mlsing","mocked","models","modems","modes","modest","modifieded","modifiered","modifiers","modished","modishes","modisted","modistes","modses","mogens","mohaves","mohses","moired","mojave","mojaves","mold","molds","mole","moles","molest","molles","mollified","mollifies","molling","molvas","mommies","monded","mondes","monels","moneys","monked","monses","montan","montanning","montans","montes","mooched","mooches","mooching","mooded","mooned","moored","moosed","mooses","mooted","mope","mopeds","mopes","more","morels","mores","morses","mortified","mortifies","moses","moseys","moshes","mosting","mote","motels","motes","motets","motiffed","motive","motives","moue","moues","moulds","mountain","mountaining","mountains","mousing","mouthed","mouthing","moveds","movie","movies","moxies","mpsing","mrsing","msbing","mscing","mses","msging","mshing","msing","muanged","muched","muches","muching","muling","mull","mullas","mulling","mulls","mullus","muming","musaing","musding","musers","muses","mushes","mushing","musing","musings","musking","mussing","muting","mutually","myalling","myalls","myopes","nadded","nailing","naives","nakeds","nalline","nanaed","nanced","nand","nanded","nandued","nanned","narded","nashes","nasuses","nauched","nauches","nauching","nave","neating","nemine","nemined","nemines","nemining","nerding","nerve","nerves","nerving","nervus","nervying","nesses","nessing","nest","nesting","nestings","nestling","nests","netting","nevers","neving","newlies","newting","nexted","nexting","nick","nicks","nigger","niggers","nilling","nisied","nisting","nitred","nitres","niveas","nivose","nivoses","nocked","node","noired","noires","nolling","nonuple","nonuples","nooked","nookied","nooksed","nooned","noosed","nosing","notched","notches","notching","notified","notifies","noting","nouses","nousing","nsaing","nscing","nsfing","nsuing","nswing","nuding","nuited","nuking","null","nulling","nulls","nuns","nurses","nursing","nutses","nutsing","nuxing","oakens","oasing","oasises","oasting","oatses","observe","observes","observing","obtain","obtaining","obtains","occluded","oceans","ochers","octalling","octuple","octuples","odisted","ogives","oilies","oising","olds","olefine","olefined","olefines","olefining","oleins","olive","olives","onlies","onto","onuses","opalling","opiated","oppose","opposes","opulus","opuses","oralling","orange","oranged","oranges","oses","osing","otuses","ouring","ousels","outclass","outclasses","outclassing","outdated","outing","outrigger","outriggers","ovalling","over","overs","overts","pacoses","pacs","pact","padded","padres","pads","paduses","paeans","pageant","pageses","paided","pailing","painses","paired","paks","palases","paliing","paling","palling","pallying","palming","palmses","paloing","pals","palsies","pandaed","pander","pangses","panned","pans","pansies","pant","panted","pantses","paps","para","parang","pare","parental","parented","parents","parers","pareve","pari","paries","paring","parises","parity","park","parr","parsec","parsecs","parsed","parsee","parsees","parser","parsers","parses","parted","parti","partis","partly","parts","partses","party","paruses","parvenu","parving","pasches","paso","pasoed","pasos","pasques","passages","passed","passeds","passee","passeed","passees","passel","passels","passer","passers","passims","passives","passkey","passkeys","passu","passued","passus","pasted","pasteds","pastel","pastels","paster","pasters","pastes","pasties","pasting","pastises","pasts","patases","patens","patent","patents","patient","pats","patsies","pauling","paulis","paused","pauses","pausing","pave","pavises","pawling","paws","payees","payment","pays","pbsing","peaked","pean","peans","peated","peating","pecans","pecses","peeves","peeving","pekans","pelling","pelting","pent","percent","perces","percing","pere","periing","pering","perking","perming","perring","pert","peruing","perve","perves","perving","pesoing","pessed","pessing","pest","pesting","pestis","pestling","pestoing","pestos","pests","petited","petrifies","petrify","petting","peyote","peyotes","peyoting","phaged","pharos","pholis","phsing","pick","picks","piered","pigses","pill","pilling","pills","pinses","pinto","pintos","pisces","piss","pissed","pisseds","pisser","pissers","pisses","pistes","pisting","pith","pitses","plaided","planaed","planked","planned","planted","plashes","plated","pleads","pleats","plover","plovers","pmsing","poached","poaches","poaching","pocked","poises","pokers","polers","polies","poll","polling","pollos","polls","pommies","ponded","ponses","pooched","pooches","pooching","pooded","poofed","pooled","pooned","pooped","poored","pooved","pooves","porched","porches","porching","porked","port","portent","posers","poshes","posies","posing","posits","possed","posses","possess","posset","possets","postes","posting","potent","pouch","pouched","pouches","pouching","powers","praises","pranged","prat","prated","preference","preferences","prelims","premies","preses","presses","prexies","pricks","prigged","prises","prom","proses","proves","prunes","prunos","prunus","psaing","psas","pses","psiing","psing","pucing","puking","pula","pulas","pule","pules","puling","pullers","pullets","pulleys","pulling","pulp","pulps","pulsing","puns","pupals","pupated","pupils","pure","purelies","purely","purifies","purify","puring","purl","purls","pursing","puses","pushing","puss","pussed","pusses","pussies","pussing","pyrene","qianged","quaing","quakes","quares","quells","questing","quests","quicks","quiing","quilt","quired","quited","quoing","quolls","rabies","racies","radded","raided","railing","raises","rake","rakes","raling","rallies","rallying","ramies","ranaed","rand","randed","randied","raneed","ranges","ranied","ranked","ranted","rarelies","rarely","rarifies","rarify","rashes","rasing","rassed","rave","ravers","readies","realines","realise","realises","realizes","reallies","really","realties","realty","reaving","rebuild","rebuilds","reburies","recall","recalling","recalls","recces","reccies","recipes","recited","recites","reclines","recode","recommits","recover","recovers","redefine","redefined","redefines","redefining","redlines","reedies","reefies","reeving","referee","referees","referenceds","referent","refine","refined","refiners","refines","refining","refinings","refits","regias","regimes","regius","reined","reining","reited","reiting","rejigs","relaces","relates","relaxes","relay","relics","relict","relicts","relied","relief","reliefs","relieve","relieves","relievo","relievos","relines","relining","relish","relishes","relived","relives","remake","remakes","remise","remises","remiss","remits","remote","remotes","remoting","remove","removes","rend","rended","rends","renins","renises","rent","repands","repens","repents","repine","repined","repining","replay","replied","replies","reply","repose","reposes","requiems","requireds","requite","requites","requote","requotes","reruns","reserve","reserves","reserving","resets","reshes","reshing","reside","resides","resids","resiles","resins","resizes","respire","respires","ressing","rest","resting","restings","rests","retied","reties","reting","retire","retouch","retouched","retouches","retouching","retries","retting","reusing","reverence","reverences","revers","review","reviews","reviles","revise","revises","revive","revoke","revokes","revues","revving","rewire","rewired","rhuses","rick","ricks","rigged","riggeds","rigger","riggers","rilling","rimies","rind","rinded","ringer","ringers","ringside","rising","risses","rive","rives","rivets","roached","roaches","roaching","rocked","rogers","roilies","rolling","rons","rooded","roofed","rooked","rookied","roomed","rooted","ropers","ropies","rosies","rosing","rouble","roubles","roughed","roughing","rounds","rouses","rousing","rove","rover","rovers","roves","rowers","rubens","rubies","rubing","rubins","rubs","rudelies","rudely","ruding","rues","rugger","ruggers","rugs","ruins","rulied","rulies","ruling","ruly","rumens","rums","rune","runes","rung","rungs","runics","runing","runt","runts","runups","ruses","rushes","rushing","rusing","rusking","russing","ruts","saales","saaling","saames","sabling","sabres","sadded","saided","sailing","saints","saises","sake","sakes","salals","saling","salk","salking","salks","salling","sallying","salols","salping","salting","salves","sand","sanded","sander","sandied","sandsed","sanned","sansed","sanses","sapling","sarded","sarding","sariing","sarsing","sashes","sass","sassed","sasses","sassies","sats","saurel","save","savers","saving","scalding","scalds","scaling","scalping","scalps","scalying","scapes","scarce","scarces","scare","scareds","scarers","scares","scarfs","scaries","scarps","scends","schick","schicks","scired","scoked","scolds","scorer","scorers","scores","scoter","scoters","screes","scries","scruple","scruples","scrying","sculling","seaing","sealing","seaming","seaport","seaporting","seaports","seareds","searing","seasing","seaxing","sebaes","sebaing","sebbing","sebing","sebses","sebsing","seccing","secluded","secure","sedans","sedding","sedges","sedging","seeding","seeing","seeking","seeling","seeming","seening","seeping","seering","segoing","segues","seguing","seiding","seifing","seiing","seined","seiths","seizes","seizing","selfing","selvaing","selvas","semiing","semited","senate","senates","senating","send","sended","sending","sends","sening","senning","senses","sensing","sent","sepping","sequine","sequines","serape","serapes","seraping","seraxes","seraxing","serbing","serene","serenes","serening","serers","seres","serfing","serge","sergers","serges","serging","series","serined","sering","serous","serowing","serows","serpens","serums","servals","servant","servers","services","servicing","serviles","serviling","servinged","servings","servo","servoing","servos","setaing","sets","seuling","sevens","sewing","sewning","sexing","sexpot","sexpots","sexpotting","sexted","sexying","shabus","shade","shadeds","shades","shadies","shafts","shagged","shake","shakens","shakers","shakes","shakies","shakos","shale","shales","shame","shameds","shames","shamus","shanged","shanked","shanks","shanned","shape","shapeds","shapers","shapes","shard","shards","shareds","sharers","shareses","sharias","shark","sharks","sharons","sharp","sharpens","sharpers","sharpie","sharpies","sharps","shart","sharts","shaveds","shavens","shavers","shaves","shaving","shawls","shawms","sheareds","shearers","shearses","sheers","sheiks","shelve","shelves","shelving","sherding","sherds","shines","shinto","shire","shires","shirks","shirrs","shited","shnooked","shocked","shocks","shoeds","shooed","shooked","shooted","shore","shoreas","shores","shorns","shorts","shotes","shover","shovers","shoving","shreds","shrews","shriving","shrove","shroves","shroving","shucks","sibs","sick","sicks","sics","sids","sieving","sifts","sights","silling","silts","sind","sinded","sing","sins","sips","sirced","sircing","sired","sirens","sires","siring","sirred","sirring","sirs","sising","siss","sisses","sitars","site","sites","sitkas","sittas","situ","situs","sitz","sitzes","sixths","skates","skinks","skints","skirts","skits","skiving","skulls","slander","slanted","slates","slaving","sleeve","sleeves","sleeving","slices","slicks","slides","slimes","slits","slivers","slouch","slouched","slouches","slouching","slsing","smalling","smalls","smarms","smarts","smited","smites","smiths","smoked","snare","snarers","snares","snarfs","snarls","sneaked","snicks","snigger","sniggers","snits","snooked","snores","soaked","soaving","sobers","socked","solare","solares","sold","solds","solids","solling","solver","solvers","solving","sooned","sooted","sorbing","sore","sorelies","sorely","soring","sorting","sots","souchong","soughed","soughing","souked","soupies","source","soured","souses","sousing","southed","southing","sowers","spaces","spades","spalling","spanged","spare","sparers","spares","sparge","sparges","sparks","spasms","spated","spates","spazes","speaked","specks","spells","sperming","sphere","spheres","spicks","spills","spinto","spired","spirts","spited","spites","spits","splits","spoked","spooked","spores","sprees","spries","sprigger","spriggers","spring","sprits","sprues","spruing","sprying","spurge","squally","squares","squires","sriing","ssaing","sses","ssing","ssping","ssriing","sssing","sswing","stacks","stages","stalk","stalks","stalling","standed","stands","stanks","stapes","stare","starers","stares","starets","starses","starts","starving","states","staving","steads","steaked","steeds","stenting","sterling","sterning","stetting","sticks","stilts","stints","stoked","stores","stover","stovers","stoving","streaked","string","stringer","stringers","striving","suaving","subclassed","suched","suches","suching","sucre","sucred","sudated","sudses","sudsing","suer","suered","suering","sues","suiing","suing","suited","suites","suits","sullas","summits","sundated","sunglass","sunglasses","sunglassing","suns","superclassed","supergrass","supergrasses","sura","suraed","suraing","surd","surded","surding","sured","surelies","sures","surety","surf","surfed","surfer","surfing","surge","surged","surging","surrey","surveys","suses","sussing","suture","suvving","svring","swages","swales","swards","swarms","swarts","sweared","sweated","swerve","swerves","swerving","swervings","swifts","swined","swiped","swirled","switch","taaling","tables","tabling","tabses","tached","taches","taching","tack","tacks","tacting","tadded","taeling","tagger","taggers","tailing","tajiks","take","takens","takers","takes","tala","talaing","talas","talc","talcing","talcs","tale","talent","tales","taling","talkers","talkies","talking","talksed","talkses","talling","tallying","talons","talus","tandem","tank","tankas","tanked","tanks","tanned","taoses","tapses","tart","tarting","task","tasking","tasks","tassed","tassel","tassels","tasses","tasset","tassets","tassing","tasting","tastings","tastying","tatting","tauting","tawses","tdting","teached","teaches","teaching","teaing","teaked","teaking","tealed","tealing","teamed","teaming","teared","tearing","teased","teases","teasing","teasling","teat","teated","teating","teats","tebets","teccing","teched","teches","tectaing","tectas","tedding","teds","teed","teeing","teeming","teened","teening","teething","teeths","teffing","tegging","teiids","tejuing","tellies","temming","temping","tempting","tempts","tenched","tenches","tenching","tendeds","tenders","tendons","tenens","tenged","tenges","tenging","tenias","tenned","tenning","tennis","tennos","tenons","tenors","tensed","tenseds","tensing","tented","tenthing","tenting","tentings","tenuis","tepids","terces","tereting","terned","terrifies","terrify","teslaing","teslas","testaing","testas","testating","testeds","testeeing","testees","testers","testes","testied","testify","testily","testinged","testings","testis","testying","tether","tething","tetting","tevets","texans","text","texted","textes","texting","textings","texts","thaned","thanked","thanks","thanned","thecas","thefting","thefts","theist","theisting","theists","theres","thesis","thinged","tholed","tholes","thonged","thorough","thoroughs","thought","thrive","thrives","throng","throngs","throughed","throughs","thrush","thuses","ticalling","tick","ticks","tiered","tigers","tilling","tilting","tineds","tinting","tire","tired","tires","tiroed","titred","titres","titting","tnting","toasting","toasts","toeaed","toeses","toesing","togethers","told","tolds","tolling","tommies","tomtits","toneds","toners","tontining","tooled","tooned","tooted","toothed","toothing","tooting","topers","toposes","topple","topples","torch","torched","torches","torching","torting","toshed","toshes","tosked","tosking","tosses","tossing","toters","toting","totting","toucan","toucans","touchers","touchied","touchies","touchinged","touchingly","touchings","touchline","touchy","touchying","tough","toughed","toughens","toughied","toughies","toughing","toughying","touped","toupee","toupeed","touping","toured","touring","tousle","tousled","tousling","touted","towers","tracks","transitive","transitived","transitives","transitivity","treaded","treads","treated","treating","treats","treeds","trekked","trend","trends","trenting","tressing","trestling","triage","triaged","tricker","trickers","tricks","triers","trifler","triflers","trigged","trimer","trimers","trimmer","trimmers","tripper","trippers","trited","triting","troched","troches","troching","trough","troughed","troughing","troughs","troves","truced","truces","trucing","trucked","trucking","trudger","trudgers","trulies","trunks","trusting","trusts","truthed","truthing","trysting","trysts","tsetse","tsetsing","tubing","tucked","tucking","tufting","tugger","tuggers","tuling","tulles","tulling","tumses","tumsing","tuning","tuns","turing","tushed","tutting","tuxing","twanged","tweaks","tweeded","tweeds","tweeped","tweeted","tweeting","tweets","tweezed","twelved","twenty","twerked","twerped","twiced","twigged","twined","twirled","twirped","twisting","twists","twitch","ufoing","uglies","uhfing","uing","ukases","ukasing","ukes","uking","ulls","ulting","umaing","umping","unchanged","unclouded","uncouple","uncouples","uncover","uncovers","undated","undateds","undefined","unding","unedited","unhooked","uniated","uning","united","unkind","unlive","unlives","unmake","unmakes","unmated","unmodified","unqing","unsated","unsees","unsung","unsure","untouched","unusually","unwired","unyoke","unyokes","upbeated","upcasted","update","updates","updrafted","uphold","upholds","uping","upland","uplanded","upsets","upside","uptaked","upvoted","urated","urging","urling","urning","urns","ursine","uruses","usages","usaging","usaing","usas","usbegs","usbeks","uscbing","usdaed","usdaing","used","useds","user","userring","users","ushers","usinged","usings","usmcing","usneas","usning","usns","usps","uspses","uspsing","usss","usssing","usualed","usuals","usurer","utaing","utcing","utes","uting","utning","uubing","uuhing","uuping","uuqing","uuting","uving","uziing","valiing","valing","valling","valses","valsing","valuing","valving","vandaed","vanned","varment","vasing","vassed","vasting","vedisted","vegans","veined","veines","veining","vend","vended","vends","venose","venoses","venosing","vent","veraing","verbified","verbifies","verbify","verbing","verdes","verding","verges","verging","veridis","veridises","veried","verified","verifieds","verifier","verifiers","verited","veritied","verities","verity","verses","versified","versifier","versifiers","versifies","versify","versing","versting","versts","vertes","verve","verves","vervets","verving","verying","vest","vesting","vests","vetting","vianded","vilifies","vilify","vinifies","vinify","virens","vireos","vising","visits","visually","vitrifies","vitrify","vive","vives","vivifies","vivify","vivred","vocalling","vomers","vomits","voters","vouch","vouched","voucheed","vouchees","vouchers","vouches","vouching","vowers","wadded","wadses","waifed","wailed","wailing","wained","waived","waives","wake","wakens","wakers","wakes","waling","walk","walking","walks","wall","walling","wallings","walls","wallying","wand","wanded","wander","wanked","wanned","want","wanted","ware","wared","waried","warmed","warned","warped","warred","warsed","warses","wart","warted","washes","wassed","wastes","wasting","watses","wauling","wave","wavers","wawling","wayses","wbsing","weaked","weaken","wealed","wean","weaned","weans","wearer","weaved","weaves","weaving","weeked","weft","wefting","weirded","weired","wekaed","welling","welt","welting","wended","wends","wens","weres","wering","westing","wests","wetting","whacks","whales","whanged","wharfs","whelks","whiled","whined","whirled","whirred","whists","whites","whits","wholed","wholes","whooped","whored","whores","wick","wicked","wicks","wided","width","widths","wifed","wified","wigged","wilded","wiled","wilied","wilies","willed","willing","wilted","wimped","winced","wind","wined","winged","winied","winked","winned","winoed","wiped","wipeds","wireds","wirer","wiried","wised","wisent","wish","wished","wising","wisped","witch","withal","withe","wither","withes","within","withs","withy","witsed","witted","wive","wived","wives","wizzed","wlanned","wokked","wold","wolds","wonked","wont","wooded","wooers","woofed","wooled","worded","worlds","wormed","worned","worsed","worted","woulds","wove","woves","wraith","wrasses","wreaked","wrecks","wresting","wrests","wricks","wried","wriggler","wrigglers","wringer","wringers","writhe","wswing","wussing","wyrded","xerotes","xmases","yanaed","yanked","yarded","yawling","yawses","yearns","yeasting","yeasts","yelling","yerring","yessing","yetting","yolked","yorked","youthed","youthing","yuling","yuses","yussing","zaired","zaires","zanied","zend","zended","zends","zeroing","zest","zesting","zests","zestying","zeuses","zeusing","zhuanged","zilling","zonked","zoomed","zooted"]}});function Es(e,t,n){if(e===t)return 0;if(Math.abs(e.length-t.length)>n)return n+1;let s=null,o=Array.from({length:t.length+1},(r,i)=>i);for(let r=1;r<=e.length;r+=1){let i=[r],a=r;for(let c=1;c<=t.length;c+=1){let l=e[r-1]===t[c-1]?0:1,u=Math.min(o[c]+1,i[c-1]+1,o[c-1]+l);r>1&&c>1&&e[r-1]===t[c-2]&&e[r-2]===t[c-1]&&(u=Math.min(u,s[c-2]+l)),i[c]=u,u<a&&(a=u)}if(a>n)return n+1;s=o,o=i}return o[t.length]}function Mu(e){return/^[a-z]+$/.test(e)&&!dt.has(e)&&!Pu.has(e)}function Dg(e){return YR(e)?null:Da(e,Fg,Ss(e))}function Da(e,t,n=Ss(e)){let s=n+1,o=null,r=!1;for(let i of t){let a=Es(e,i,Math.min(s,n));a<s?(s=a,o=i,r=!1):a===s&&a<=n&&i!==o&&(r=!0)}return s<=n&&!r?o:null}var qR,Ss,Pu,Mg,Fg,KR,YR,pr=M(()=>{Kn();Lg();kn();qR=["used"];Ss=e=>e.length<=5?1:2,Pu=new Set([...Object.keys(me),...Object.keys(Ze),...Object.keys(mn),...qR].flatMap(e=>e.split(" "))),Mg=4,Fg=[...new Set([...Object.keys(me),...Object.keys(mn)].flatMap(e=>e.split(" ")).filter(e=>e.length>=Mg))],KR=new Set(Pg.words),YR=e=>KR.has(e)});function mr(e){for(let t of ZR){let n=e.match(t.re);if(n){let s=t.build(n);if(s)return s}}return null}var za,XR,JR,QR,Fu,ZR,zg,Ua=M(()=>{Kn();kn();za=Object.keys(me).sort((e,t)=>t.length-e.length).map(ot).join("|"),XR=Object.keys(Ze).sort((e,t)=>t.length-e.length).map(ot).join("|"),JR=Object.keys(mn).sort((e,t)=>t.length-e.length).map(ot).join("|"),QR=yo.slice().sort((e,t)=>t.length-e.length).map(ot).join("|"),Fu=(e,t)=>e==="defines"&&Qr.has(t),ZR=[{name:"ask",re:new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+(${za})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=me[t];return Fu(n,t)?null:Ws({shape:"ask",entityType:null,modifier:"direct",kind:n,subject:e[1].trim(),object:e[3].trim()},t)}},{name:"reverse",re:new RegExp(`^which\\s+(${XR})\\s+(?:(${JR})\\s+)?(${za})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[3].toLowerCase(),n=me[t];return Fu(n,t)?null:Ws({shape:"reverse",entityType:Ze[e[1].toLowerCase()],modifier:e[2]?mn[e[2].toLowerCase()]:"direct",kind:n,object:e[4].trim()},t)}},{name:"forward",re:new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+(${za})\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=me[t];return Fu(n,t)?null:Ws({shape:"forward",entityType:null,modifier:"direct",kind:n,object:e[1].trim()},t)}},{name:"meta-mean",re:new RegExp(`^what\\s+(?:does|do|is|are)\\s+(.+?)\\s+(?:${QR})\\??$`,"i"),build:e=>({shape:"meta",entityType:null,modifier:"direct",kind:"meta",object:e[1].trim()})},{name:"meta-whatis",re:new RegExp("^what\\s+(?:is|are)\\s+(?:(an?|the)\\s+)?(.+?)\\??$","i"),build:e=>{let t=e[1]?e[1].toLowerCase():null,n=pn(e[2].trim()),s=!/\s/.test(n);if(t==="the"&&!s||!t&&!Ze[n.toLowerCase()])return null;let o=n.toLowerCase();return t&&t!=="the"&&Xm.some(r=>o===r||o.startsWith(`${r} `))?null:{shape:"meta",entityType:null,modifier:"direct",kind:"meta",object:Gs(n)}}},{name:"mention",re:new RegExp(`^where\\s+(?:is|are|was|were)\\s+(.+?)\\s+(?:${Mn.map(ot).join("|")})\\??$`,"i"),build:e=>({shape:"mentions",entityType:null,modifier:"direct",kind:"mentions",object:e[1].trim()})},{name:"where",re:new RegExp(`^where\\s+(?:is|are|was|were)\\s+(.+?)(?:\\s+(?:${fn.map(ot).join("|")}))?\\??$`,"i"),build:e=>({shape:"where",entityType:null,modifier:"direct",kind:"where",object:e[1].trim()})},{name:"when",re:new RegExp(`^when\\s+(?:did|does|do|was|were|is)\\s+(.+?)\\s+(?:last\\s+)?(${za})\\??$`,"i"),build:e=>me[e[2].toLowerCase()]==="touches"?{shape:"when",entityType:null,modifier:"direct",kind:"touches",object:e[1].trim()}:null},{name:"commit-history",re:/^(?:the\s+)?commit\s+history\s+(?:of|for)\s+(.+?)\??$/i,build:e=>({shape:"when",entityType:null,modifier:"direct",kind:"touches",object:e[1].trim()})},{name:"cochange-partners",re:/^co-?change\s+partners\s+(?:of|for|with)\s+(.+?)\??$/i,build:e=>({shape:"reverse",entityType:"Module",modifier:"direct",kind:"cochange",object:e[1].trim()})}];zg={id:"grammar",class:"graph-query",run(e){let t=mr(e);return t?{strategyId:"grammar",class:"graph-query",candidates:[{parsed:t,confidence:.9}]}:null}}});function Ug(e){let t=e.trim().split(/\s+/);return t.length>1&&$a.has(t[0].toLowerCase())}function s_(e){return me[e.trim().toLowerCase()]==="calls"}function Mt(e,t,n=null){let s=Object.keys(t).sort((o,r)=>r.split(" ").length-o.split(" ").length);for(let o of s){let r=o.split(" ");for(let i=0;i<=e.length-r.length;i+=1)if(!(n&&r.some((a,c)=>n.has(i+c)))&&r.every((a,c)=>e[i+c]===a))return{kind:t[o],start:i,end:i+r.length}}return null}function fi(e,t=null){let n=e.replace(/\?+\s*$/,"").replace(/,/g," ").split(/\s+/).filter(Boolean),s=n.map(x=>x.toLowerCase());if(s.includes("where")&&!Mt(s,me)){let x=s.some(T=>Mn.includes(T)),R=new Set([...fn,...Mn]),w=n.filter((T,I)=>!dt.has(s[I])&&!R.has(s[I])).join(" ").trim();if(w){let T=x?"mentions":"where";return{shape:T,entityType:null,modifier:"direct",kind:T,object:w}}}if(new Set(["has","have","had"]).has(s[0])){let x=s.length;for(;x>1&&(s[x-1]==="ever"||s[x-1]==="been");)x-=1;if((x>1?me[s[x-1]]:null)==="touches"){let w=n.slice(1,x-1).filter((T,I)=>!dt.has(s[1+I])).join(" ").trim();if(w)return{shape:"when",entityType:null,modifier:"direct",kind:"touches",object:w}}}let r=s,i=Mt(s,me);if(!i&&t){let x=s.map(R=>{if(!Mu(R))return R;let w=t.lemma(R);return Pu.has(w)?w:R});i=Mt(x,me),i&&(r=x)}let a=null;if(!i){let x=s.map(R=>R.length>=4&&Mu(R)&&Dg(R)||R);if(i=Mt(x,me),i){r=x;let R=s.slice(i.start,i.end).findIndex((T,I)=>T!==x[i.start+I]),w=i.start+Math.max(R,0);a={from:s[w],to:x[w]}}}let c=!1;if(!i)for(let x=0;x<s.length;x+=1){let R=Vs[s[x]];if(!(R&&s[x]==="used"&&s[x+1]==="for")&&R&&s.slice(0,x).some(w=>di.has(w))){i={kind:R,start:x,end:x+1},c=!0;break}}if(!i)return null;!c&&i.end-i.start===1&&Vs[s[i.start]]&&s.slice(0,i.start).some(x=>di.has(x))&&(c=!0);let l=x=>a?{...x,fuzzyVerb:a}:x;if(t&&i.end-i.start===1){let x=i.start,R=s[x-1];if((R==="the"||R==="these"||R==="those")&&s[x+1]==="of"&&t.posTags(n)[x]==="NOUN"){let T=n.slice(x+2).filter((I,j)=>!dt.has(s[x+2+j])).join(" ").trim();if(T)return l({shape:"forward",entityType:null,modifier:"direct",kind:i.kind,object:T})}}let u=new Set,d=x=>{if(x)for(let R=x.start;R<x.end;R+=1)u.add(R)};d(i);for(let[x,R]of Object.entries(me)){if(R!==i.kind)continue;let w=x.split(" "),T=i.end;if(w.every((I,j)=>r[T+j]===I)){d({start:T,end:T+w.length});break}}let p=Mt(r,Ze,u);d(p);let f=Mt(r,mn,u);d(f);let m=(x,R)=>n.slice(x,R).filter((w,T)=>!u.has(x+T)&&!dt.has(s[x+T])).join(" ").trim(),h=m(0,i.start),g=m(i.end,n.length);c&&!s.includes("by")&&n_.has(g.toLowerCase())&&(g="");let b=i.kind,y=p?Ze[r.slice(p.start,p.end).join(" ")]:null,$=f?mn[r.slice(f.start,f.end).join(" ")]:"direct",E=r.slice(i.start,i.end).join(" ");if(b==="touches"&&s.includes("when")){let x=h||g;if(x)return l({shape:"when",entityType:null,modifier:"direct",kind:"touches",object:x})}if(b==="touches"&&s.includes("who")&&s.includes("last")){let x=h||g;if(x)return l({shape:"whoLast",entityType:null,modifier:"direct",kind:"touches",object:x})}let _=s.indexOf("by"),v=s.slice(0,i.start).findIndex(x=>di.has(x)),S=v>=0,C=S&&v>_;if(_>=0&&!u.has(_)&&S){let x=(T,I)=>n.slice(T,I).filter((j,k)=>{let P=T+k,U=s[P];return!u.has(P)&&!dt.has(U)&&U!=="by"&&!di.has(U)&&!e_.has(U)&&!t_.has(U)}).join(" ").trim(),[R,w]=C?[x(v+1,n.length),x(_+1,v)]:[x(0,_),x(_+1,n.length)];if(R&&w)return b==="defines"&&Qr.has(r.slice(i.start,i.end).join(" "))?null:l({shape:"ask",entityType:null,modifier:"direct",kind:b,subject:w,object:R});if(w)return l({shape:"forward",entityType:y,modifier:$,kind:b,object:w});if(R)return l({shape:"reverse",entityType:y,modifier:$,kind:b,object:R})}if(c&&_<0&&g&&s[i.start]==="called")return null;if(h&&g){if(b==="defines"&&Qr.has(E)||b==="calls"&&(Ug(g)||s_(h)))return null;let x=c&&_<0?va[`${s[i.start]} ${s[i.end]}`]:null;return x&&x.role==="agent"&&x.kind===b?l({shape:"ask",entityType:null,modifier:"direct",kind:b,subject:g,object:h}):l(Ws({shape:"ask",entityType:null,modifier:"direct",kind:b,subject:h,object:g},E))}if(g){if(b==="calls"&&Ug(g))return null;let x=p&&p.start>=i.end?null:y;return l(Ws({shape:"reverse",entityType:x,modifier:$,kind:b,object:g},E))}if(b==="inherits"&&!h&&p&&p.start===i.end){let x=r.slice(p.start,p.end).join(" ");if(x)return l({shape:"reverse",entityType:null,modifier:$,kind:b,object:x})}if(h&&!g&&S&&i.end-i.start===1&&Vs[s[i.start]]){if(h.split(/\s+/).length>1)return null;if(b==="touches")return l({shape:"when",entityType:null,modifier:"direct",kind:b,object:h});let x=di.has(s[0]);return l({shape:"reverse",entityType:y,modifier:$,kind:b,object:h,...x?{polar:!0}:{}})}return h?l(Ws({shape:"forward",entityType:y,modifier:"direct",kind:b,object:h},E)):null}var di,e_,t_,n_,Bg,Ba=M(()=>{Kn();kn();pr();di=new Set(["is","are","was","were","be","been","being","get","gets","got"]),e_=new Set(["which","what","who","whom","whose"]),t_=new Set(bs.map(e=>e.toLowerCase())),n_=new Set(["recently","lately","yet","already","ever","again"]);Bg={id:"keyword-spot",class:"graph-query",run(e,t={}){let n=fi(e,t.nlp||null);return n?{strategyId:"keyword-spot",class:"graph-query",candidates:[{parsed:n,confidence:.7}]}:null}}});function r_(e,t,n){if(!n||typeof n.posTags!="function"||!t.length)return[];let s=new Set(t.map(i=>i.toLowerCase())),o;try{o=n.posTags(e)}catch{return[]}let r=[];for(let i=0;i<e.length;i+=1){let a=e[i],c=a.toLowerCase();!/^[a-z]+$/.test(a)||Wg.has(c)||!s.has(c)||o[i]==="VERB"&&r.push(c)}return r}function i_(e,t=null){let n=sn(e),s=[],o=[];for(let i of n){let a=i.toLowerCase();/^[a-z]+$/.test(i)&&!Wg.has(a)&&(o_.has(a)||t&&typeof t.isStopWord=="function"&&t.isStopWord(a))?o.push(i):s.push(i)}let r=r_(n,s,t);return{text:s.join(" "),dropped:o,maybeNoise:r}}var Wg,o_,Gg,Vg=M(()=>{Kn();kn();Ua();Ba();Wg=new Set([...dt,...ge(wo),...ge(Object.keys(me)),...ge(Object.keys(Ze)),...ge(Object.keys(mn)),...ge(Object.keys(ct)),...ge($o),...ge(vo),...ge(Object.keys(Hn)),...ge(Object.keys(qn)),...ge(Object.keys(sr)),...ge(bs),...ge(ei),...ge(yo),...ge(fn),...ge(Mn),...ge(En),...ge(Object.keys(rr))]),o_=new Set([...ge(Zr),...ge(xa)]);Gg={id:"noise-strip",class:"noise-stripped",run(e,t={}){if(mr(e))return null;let{text:n,dropped:s,maybeNoise:o}=i_(e,t.nlp||null);if(!s.length||!n)return null;let r=mr(n)||fi(n,t.nlp||null);if(!r)return null;if(o.length&&(r.shape==="where"||r.shape==="mentions")&&r.object){let i=r.object.split(/\s+/).filter(a=>!o.includes(a.toLowerCase())).join(" ").trim();i&&i!==r.object&&(r.altObject=i)}return{strategyId:"noise-strip",class:"noise-stripped",candidates:[{parsed:r,confidence:.75,note:`noise-stripped to "${n}"`}]}}}});var Hg=M(()=>{});var Wa,Ga=M(()=>{Wa=()=>{}});function Kg(e,t){return e.shape!==t.shape||e.kind!==t.kind?!1:e.shape==="ask"?hr(e.subject)===hr(t.subject)&&hr(e.object)===hr(t.object):hr(e.object)===hr(t.object)}function Du(e){let t=(e||[]).filter(l=>l&&Array.isArray(l.candidates)&&l.candidates.length);if(!t.length)return null;let n=[];for(let l of t)for(let u of l.candidates)!u||!u.parsed||n.push({parsed:u.parsed,confidence:typeof u.confidence=="number"?u.confidence:.5,note:u.note||null,via:u.via||null,strategyId:l.strategyId,class:l.class});if(n.some(l=>!Yg(l))&&(n=n.filter(l=>!Yg(l))),!n.length)return null;let s=new Map;for(let l of n)s.has(l.class)||s.set(l.class,[]),s.get(l.class).push(l);let o=[];for(let[l,u]of s){let d=[];for(let p of u){let f=d.find(m=>Kg(m.parsed,p.parsed)&&m.via===p.via);if(f){f.agreed+=1,f.confidence=Math.max(f.confidence,p.confidence),qg(p.parsed)<qg(f.parsed)&&(f.parsed=p.parsed);continue}d.push({...p,agreed:1})}d.length&&o.push({class:l,candidates:d})}if(!o.length)return null;let r=l=>Math.max(...l.candidates.map(u=>u.confidence)),i=o[0];for(let l of o)r(l)>r(i)&&(i=l);let a=i.candidates.length===1?i.candidates[0].parsed:{ambiguousParse:!0,candidates:i.candidates.map(l=>l.parsed)},c=o.filter(l=>l!==i).map(l=>l.candidates[0]).filter(l=>!i.candidates.some(u=>Kg(u.parsed,l.parsed)));return{class:i.class,parsed:a,winner:i.candidates[0],alternates:c}}function l_(e){if(!e)return"something else";if(e.ambiguousParse)return"one of several readings";let t=e.object??e.subject??"?";return`${e.kind} "${t}"`}function Xg(e,{describe:t=l_,answerFor:n=null}={}){return(e||[]).map(s=>{let o=s.note||t(s.parsed),r=n&&n(s)||"ask it that way";return`if you mean ${o} then ${r}`})}var hr,a_,qg,c_,Yg,zu=M(()=>{hr=e=>String(e||"").trim().toLowerCase().replace(/\s+/g," ").replace(/^(?:the|a|an)\s+/,"").replace(/^commit\s+(?=[0-9a-f]{7,40}$)/,""),a_=/^\s*(?:the|a|an)\s+/i,qg=e=>[e?.subject,e?.object].filter(t=>a_.test(String(t||""))).length;c_=new Set(["fuzzy","lemma","spell"]),Yg=e=>c_.has(e.via)});function Va(e){Uu=e}function Ha(){return typeof Uu=="function"?Uu():null}var Uu,gr=M(()=>{Uu=null});function Zg(e,t={},n=d_){let s=[];for(let o of n)try{let r=o.run(e,t);r&&typeof r.then!="function"&&s.push(r)}catch{}return s}var u_,d_,eb=M(()=>{kn();Ua();Ba();Vg();Hg();Ga();zu();gr();u_=[...typeof void 0<"u"?[void 0]:[],...typeof void 0<"u"?[void 0]:[]],d_=[zg,Bg,Gg,...u_]});function ko(e){return f_.test(String(e||"").trim())?"an":"a"}function qa(e){let t=String(e||"").trim();return t&&(/(?:s|x|z|ch|sh)$/.test(t)?`${t}es`:/[^aeiou]y$/.test(t)?`${t.slice(0,-1)}ies`:`${t}s`)}function br(e){let t=String(e||"");return t&&t[0].toUpperCase()+t.slice(1)}function pi(e){let t=(e||[]).map(n=>String(n||"").trim()).filter(Boolean);return t.length===0?"":t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t[t.length-1]}`}var f_,mi=M(()=>{f_=/^[aeiou]/i});var hi,Bu=M(()=>{hi=(e,t,n)=>n});var Xb={};Lt(Xb,{DYNAMIC_TAIL_OK_RE:()=>$d,applyNegationFrames:()=>ui,ask:()=>eo,classDisplayName:()=>ks,degreeMetric:()=>Ub,metaFallbackEntityAnswer:()=>Nb,normalizeQuery:()=>jo,parseQuery:()=>To,parseQueryFull:()=>od,render:()=>zn,rephraseHint:()=>md,resolveObject:()=>wn,traverse:()=>on,worldRelationGraphPayload:()=>pA});function Qe(e,t){let n=tb.get(e);n||(n=new Map,tb.set(e,n));let s=n.get(t);if(s)return s;let o=[];for(let r of e.relations)if(xs(r)===t)for(let i of r.edges)o.push(i);return n.set(t,o),o}function Te(e,t){let[n,s]=qu[e]||["result","results"];return t===1?n:s}function vi(e,t,n,s={}){return!e||!t.length?[]:[{kind:"set",class:e,label:`${t.length} ${Te(e,t.length)}`,ids:t.map(o=>o.id),attrs:{count:t.length},lane:n,...s}]}function ks(e){let t=String(e||"");if(typeof Yn=="function"){let n=Yn(t).join(" ");if(n)return n}return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase()}function Qs(e){return m_[e]||e}function y_(e){if(!e?.ambiguousParse||!Array.isArray(e.candidates)||e.candidates.length!==2)return e;let t=e.candidates.find(r=>r?.shape==="meta"),n=e.candidates.find(r=>r!==t);if(!t||!n)return e;let s=String(t.object||"").trim().toLowerCase();if(!s||w_.has(s))return e;let o=String(n.object||"").trim().toLowerCase();return ge(yo).includes(o)?t:e}function v_(e,t){if(!e||e.shape!=="where"||e.altObject||!$_.test(t))return e;let n=ya(t),s=ya(String(e.object||"")),o=s===e.object?e:{...e,object:s},r=sn(s);if(r.length<2)return o;let i=r[r.length-1].toLowerCase();if(!/^[a-z][a-z'-]*$/.test(i)||dt.has(i)||me[i]||i.endsWith("ing"))return o;let a=sn(n).map(l=>l.toLowerCase());for(;a.length&&wb.has(a[a.length-1]);)a.pop();if(a[a.length-1]!==i)return o;let c=r.slice(0,-1).join(" ");return{...e,object:c,altObject:s,verb:i}}function To(e,{nlp:t=void 0}={}){return od(e,{nlp:t}).parsed}function od(e,{nlp:t=void 0}={}){let n=t===void 0?Ha():t,s=String(e||"").trim().replace(/\s+/g," ");if(!s)return{parsed:null,alternates:[],class:null};let o=Lu(ui(jo(s)));if(!o)return{parsed:null,alternates:[],class:null};let r=E_(o,n);if(r)return{parsed:r,alternates:[],class:null};let i=Du(Zg(o,{nlp:n,raw:s}));return i?{parsed:v_(y_(i.parsed),o),alternates:i.alternates||[],class:i.class||null}:{parsed:null,alternates:[],class:null}}function Yu(e,t){return t.length&&rd.has(t[0])?{bw:e.slice(1),blc:t.slice(1)}:{bw:e,blc:t}}function yr(e,t){return mr(e)||fi(e,t)}function E_(e,t){let n=sn(e),s=n.map(o=>o.toLowerCase());return q_(n,s)||Y_(n,s)||R_(n,s,t)||vb(e,t,0)||X_(n,s,t)||T_(n,s,t)||M_(n,s,t,0)||B_(n,s,t,0)||jb(n,s)||V_(n,s,t)||J_(n,s,t)||eT(n,s,t)||nT(n,s,t,0)||Z_(n,s,t,0)||Eb(n,s,t,0)||ad(n,s,t,0)||Sb(n,s,t,0)||I_(n,s,t)||j_(n,s)||Tb(n,s,t,0)}function j_(e,t){let n=0;S_.has(t[n])&&(n+=1);let s=ut(t[n]);if(!s||s.placeholder||!s.entityType)return null;let o=s.entityType;n+=1;let r=m=>m+1<t.length?va[`${t[m]} ${t[m+1]}`]:void 0,i=r(n);if(!i)return null;let a=n+2,c=-1,l;for(let m=a;m+1<t.length;m+=1){let h=r(m);if(h){c=m,l=h;break}}if(c<0)return null;let u=e.slice(a,c).join(" ").trim(),d=e.slice(c+2).join(" ").trim();if(!u||!d)return null;let p=(m,h)=>m.role==="object"?{shape:"reverse",kind:m.kind,entityType:o,modifier:"direct",object:h}:{shape:"forward",kind:m.kind,modifier:"direct",object:h},f=p(i,u);return f.entityType=o,{node:"boolean",entityType:o,atoms:[{op:"seed",kind:"set",ast:{node:"clause",clause:f}},{op:"intersection",kind:"set",ast:{node:"clause",clause:p(l,d)}}]}}function Ya(e,t){return{node:"boolean",entityType:e,atoms:[{op:"seed",kind:"set",ast:{node:"allOfClass",entityType:e}},t]}}function R_(e,t,n){if(!["do","does","did"].includes(t[0])||!k_.has(t[1]))return null;let s=ut(t[2]);if(!s||s.placeholder||!s.entityType)return null;let o=s.entityType;if(o==="Change")return{node:"miss",reason:`"${t[2]}" isn't an enumerable kind \u2014 a universal check needs a concrete kind (functions, classes, modules, \u2026)`};let r=t[2],i=e.slice(3),a=t.slice(3);if(!i.length)return null;let c=Mt(a,me);if(!c)return{node:"miss",reason:"a universal check needs a known relation verb (import, call, inherit from, test, \u2026)"};let u=i.filter((p,f)=>(f<c.start||f>=c.end)&&!dt.has(a[f])&&a[f]!=="from").join(" ").trim();if(!u)return null;let d=_s(`which ${r} ${i.join(" ")}`,n,1);return!d||d.node==="miss"?{node:"miss",reason:d&&d.reason||"the universal clause didn't parse"}:{node:"universal",entityType:o,kind:c.kind,object:u,complement:Ya(o,{op:"difference",kind:"set",ast:d})}}function vb(e,t,n=0){let s=Ng(e);if(!s)return null;let o=ut(s.entWord);if(!o||o.placeholder||!o.entityType)return null;let r=o.entityType;if(r==="Change")return{node:"miss",reason:`"${s.entWord}" isn't an enumerable kind \u2014 a set complement needs a concrete kind (functions, classes, modules, \u2026)`};let i=sn(s.predicate),a=i.map(d=>d.toLowerCase());if(a.length&&a.every(d=>ct[d]))return Ya(r,{op:"difference",kind:"qual",filters:a});let c=Mt(a,me);if(!c)return{node:"miss",reason:"a negated set query needs a known relation verb (import, call, inherit from, test, \u2026)"};if(!i.filter((d,p)=>(p<c.start||p>=c.end)&&!dt.has(a[p])&&a[p]!=="from").length)return Ya(r,{op:"difference",kind:"set",ast:{node:"existsEdge",entityType:r,kind:c.kind}});let u=_s(`which ${s.entWord} ${s.predicate}`,t,n+1);return!u||u.node==="miss"?{node:"miss",reason:u&&u.reason||"the negated clause didn't parse"}:Ya(r,{op:"difference",kind:"set",ast:u})}function T_(e,t,n){let s=0;for(;s<t.length&&__.has(t[s]);)s+=1;if(!["do","does","did"].includes(t[s]))return null;s+=1;let o=e.slice(s),r=t.slice(s),i=r.indexOf("not");if(i<0)return null;let a=Mt(r,me);if(!a)return null;let l=o.filter((u,d)=>d!==i&&(d<a.start||d>=a.end)&&r[d]!=="from"&&!dt.has(r[d])).join(" ").trim();return l?{node:"forwardComplement",kind:a.kind,subjectTerm:l}:null}function id(e,t){let n=new Set;for(let s of t)for(let o of Qe(e,s)){let r=e.byId.get(o.object);r&&r.class&&n.add(r.class)}return n}function xb(e,t){let n=At(t),s=n.filter(r=>!bb.has(r)),o=id(e,s.length?s:n);return o.size===1?[...o][0]:null}function _s(e,t,n){if(n>yb)return{node:"miss",reason:"too deep to resolve"};let s=vb(e,t,n);if(s)return s;let o=sn(e),r=o.map(p=>p.toLowerCase()),i=jb(o,r);if(i)return i;let a=Eb(o,r,t,n);if(a)return a;let c=ad(o,r,t,n);if(c)return c;let l=Sb(o,r,t,n);if(l)return l;let u=Tb(o,r,t,n);if(u)return u;let d=yr(e,t);return d?{node:"clause",clause:d}:null}function ad(e,t,n,s){for(let o=1;o<t.length;o+=1){let r=En.includes(t[o]),i=!r&&$b(t[o]);if(!r&&!i||r&&o+1>=t.length||!ut(t[o-1]))continue;let c=e.slice(0,o-1);if(!c.length||c.every(p=>ct[p.toLowerCase()]))continue;let l=yr([...c,Ku].join(" "),n);if(!l||l.shape!=="reverse"&&l.shape!=="forward"||l.modifier&&l.modifier!=="direct")continue;let u=`which ${t[o-1]} ${e.slice(r?o+1:o).join(" ")}`,d=_s(u,n,s+1);return!d||d.node==="miss"?d?{node:"miss",reason:d.reason||"inner clause didn't parse"}:{node:"miss",reason:"inner clause didn't parse"}:{node:l.shape==="reverse"?"reverseSet":"forwardSet",kind:l.kind,entityType:l.entityType,inner:d}}return null}function Eb(e,t,n,s){let o=0;(Zs.has(t[o])||cd.has(t[o]))&&(o+=1);let r=ut(t[o]);if(!r||r.placeholder||!r.entityType||(o+=1,rd.has(t[o])&&(o+=1),!A_.has(t[o])||t[o+1]!=="in"))return null;let i=e.slice(o+2);return i.length?ld(r.entityType,i,n,s):null}function Sb(e,t,n,s){let o=0;if(!Zs.has(t[0]))return null;o+=1;let r=ut(t[o]);if(!r)return null;o+=1;let i=e.slice(o),a=t.slice(o);if(i.length<2)return null;let c=null;for(let h=i.length-1;h>0;h-=1){let g=a.slice(h),b=Mt(g,me);if(b&&b.start===0&&b.end===g.length){c={kind:b.kind,at:h};break}}if(!c)return null;let l=i.slice(0,c.at),u=a.slice(0,c.at);if(!u.some(h=>En.includes(h)))return null;let d=l,p=u;for(;p.length&&cd.has(p[0]);)d=d.slice(1),p=p.slice(1);if(!p.length||!ut(p[0]))return null;let f=Zs.has(p[0])?d.join(" "):`which ${d.join(" ")}`,m=_s(f,n,s+1);return!m||m.node==="miss"?{node:"miss",reason:m&&m.reason||"the embedded subject clause didn't parse"}:{node:"forwardSet",kind:c.kind,entityType:r.entityType,inner:m}}function I_(e,t,n){for(let s=0;s<t.length;s+=1){if(!C_.has(t[s])||t[s-1]==="of")continue;let o=s===t.length-1,r=s+1<t.length&&!!me[t[s+1]];if(!o&&!r)continue;let i=[...e.slice(0,s),Ku,...e.slice(s+1)],a=yr(i.join(" "),n);if(!(!a||a.shape!=="reverse"&&a.shape!=="forward")&&a.object===Ku&&!(a.modifier&&a.modifier!=="direct"))return{node:a.shape==="reverse"?"reverseSet":"forwardSet",kind:a.kind,entityType:a.entityType,inner:{node:"prevSet"}}}return null}function M_(e,t,n,s=0){if(t[0]!=="when")return null;let o=1;if(!O_.has(t[o]))return null;o+=1;let r=-1;for(let d=t.length-1;d>=o;d-=1)if(N_.has(t[d])){r=d;break}if(r<0)return null;let i=e.slice(o,r),a=t.slice(o,r);for(;a.length&&L_.has(a[a.length-1]);)i=i.slice(0,-1),a=a.slice(0,-1);for(;a.length&&P_.has(a[0]);)i=i.slice(1),a=a.slice(1);if(!i.length||!a.some(d=>En.includes(d)))return null;let c=Zs.has(a[0])?i.join(" "):`which ${i.join(" ")}`,l=_s(c,n,s+1);if(!l||l.node==="miss")return l?{node:"miss",reason:l.reason||"the inner set of the temporal query didn't parse"}:{node:"miss",reason:"the inner set of the temporal query didn't parse"};let u=ut(a[0]);return{node:"temporal",inner:l,entityType:u&&u.entityType||null}}function jb(e,t){if(!D_.has(t[0]))return null;let n=1,s=null;if(t[n]!=="changed"){let i=ut(t[n]);if(!i||i.placeholder)return null;s=i.entityType,n+=1}if(t[n]!=="changed"||(n+=1,t[n]==="ever"&&(n+=1),!F_.has(t[n])))return null;let o=t[n],r=e.slice(n+1).join(" ").trim();return r?{node:"commitFilter",op:o,pivotRaw:r,entityType:s}:{node:"miss",reason:`"changed ${o}" needs a date or commit afterward`}}function ld(e,t,n,s){let o=t.map(r=>r.toLowerCase());if(o.some(r=>En.includes(r))){let r=t,i=o;for(;i.length&&cd.has(i[0]);)r=r.slice(1),i=i.slice(1);if(i.length&&ut(i[0])){let a=Zs.has(i[0])?r.join(" "):`which ${r.join(" ")}`,c=_s(a,n,s+1);return!c||c.node==="miss"?{node:"miss",reason:c&&c.reason||"the owner clause of this membership query didn't parse"}:{node:"membershipSet",entityType:e,inner:c}}}return{node:"membership",entityType:e,term:t.join(" ")}}function B_(e,t,n,s=0){if(t[0]!=="where"||!z_.has(t[1])||!wb.has(t[t.length-1]))return null;let o=e.slice(2,t.length-1),r=t.slice(2,t.length-1);for(;r.length&&U_.has(r[0]);)o=o.slice(1),r=r.slice(1);if(!o.length||!r.some(l=>En.includes(l)))return null;let i=ut(r[0]);if(!i)return null;let a=Zs.has(r[0])?o.join(" "):`which ${o.join(" ")}`,c=_s(a,n,s+1);return!c||c.node==="miss"?{node:"miss",reason:c&&c.reason||"the inner set of the location query didn't parse"}:{node:"whereSet",inner:c,entityType:i.entityType||null}}function G_(e){let t=new Set,n=[];for(let s of e){if(!s||!W_.test(s))continue;let o=s.toLowerCase();t.has(o)||(t.add(o),n.push(s))}return n}function V_(e,t,n){if(t.length===2&&t[0]==="which"&&(t[1]==="ones"||t[1]==="one"))return{node:"anaphora",mode:"list",filter:{type:"all"}};let s=-1,o=!1;for(let d=1;d<t.length;d+=1){if(!ei.includes(t[d]))continue;if(t[d-1]==="of"){s=d,o=!0;break}let p=t.slice(0,d).join(" ");if(d===t.length-1&&($o.includes(p)||vo.includes(p))){s=d;break}}if(s<0)return null;let r=(o?t.slice(0,s-1):t.slice(0,s)).join(" "),i=$o.includes(r)||/^(how many|how much|count|number|quantity|total)\b/.test(r)?"count":"list",a=H_(e.slice(s+1),n);if(a===void 0)return{node:"miss",reason:"the follow-up filter didn't parse"};let c=o?s-1:s,l=G_(e.slice(0,c)),u={node:"anaphora",mode:i,filter:a};return l.length>=2&&(u.candidateTerms=l),u}function H_(e,t){let n=0,s=e.map(a=>a.toLowerCase());for(;n<s.length&&x_.has(s[n]);)n+=1;let o=e.slice(n),r=s.slice(n);if(!o.length)return{type:"all"};if(r.every(a=>ct[a]))return{type:"qual",filters:r};if(o.length===1){let a=ut(r[0]);if(a&&!a.placeholder&&a.entityType)return{type:"entity",entityType:a.entityType}}let i=yr(`what ${o.join(" ")}`,t);if(i&&(i.shape==="reverse"||i.shape==="forward")&&i.object)return{type:"clause",clause:i}}function q_(e,t){let n;if(t[0]==="is"&&t[1]==="there")n=2;else if(t[0]==="are"&&t[1]==="there")n=2;else return null;let s=t[n];if(s==="a"||s==="an"||s==="any")n+=1;else return null;let o=n<t.length?ut(t[n]):null;if(!o||o.placeholder||!o.entityType)return null;let r=o.entityType;n+=1;let i=t.slice(n),a=e.slice(n);if(i.length&&i[i.length-1]==="anywhere"?(i=i.slice(0,-1),a=a.slice(0,-1)):i.length>=2&&i[i.length-2]==="at"&&i[i.length-1]==="all"&&(i=i.slice(0,-2),a=a.slice(0,-2)),!i.length)return{node:"exists",entityType:r,term:null,scopeModule:null};if(i[0]==="called"||i[0]==="named"){if(i.length<2)return{node:"miss",reason:`"${i[0]}" needs a name afterward`};let c=i.indexOf("in",1);if(c>0){let u=a.slice(1,c).join(" ").trim(),d=a.slice(c+1).join(" ").trim();return!u||!d?{node:"miss",reason:'a named existence check needs both a name and a module after "in"'}:{node:"exists",entityType:r,term:u,scopeModule:d}}let l=a.slice(1).join(" ").trim();return l?{node:"exists",entityType:r,term:l,scopeModule:null}:{node:"miss",reason:`"${i[0]}" needs a name afterward`}}if(i[0]==="in"){let c=a.slice(1).join(" ").trim();return c?{node:"exists",entityType:r,term:null,scopeModule:c}:{node:"miss",reason:'"in" needs a module afterward'}}return null}function K_(e,t){if(!t.length)return null;let n=`${e} ${t.join(" ")}`,s=Gs(n).slice(e.length).trim(),o=sn(s),r=o.findIndex(a=>a.toLowerCase()==="in");if(r<0)return null;let i=o.slice(r+1).join(" ").trim();return i?{scope:i}:{node:"miss",reason:'"in" needs a scope afterward'}}function Y_(e,t){if(t[0]!=="is"&&t[0]!=="are"||t[1]==="there")return null;let n=-1,s=!1;for(let l=1;l<t.length;l+=1)if(ct[t[l]]){n=l,s=t[l-1]==="not";break}if(n<0)return null;let o=t.indexOf("by",n+1);if(o>0&&Vs[t[n]]){let l=o+1;for(;l<t.length&&(t[l]==="the"||t[l]==="a"||t[l]==="an");)l+=1;let u=t[l];if(u&&!eh.has(u))return null}let r=K_(t[n],e.slice(n+1));if(r?.node==="miss")return r;let i=1;t[i]==="the"&&(i+=1);let a=s?n-1:n;a>i&&(t[a-1]==="a"||t[a-1]==="an")&&(a-=1);let c=a>i?e.slice(i,a).join(" ").trim():"";return c?{node:"qualCheck",term:c,qualifier:t[n],negated:s,scope:r?.scope||null}:{node:"miss",reason:'"is/are <qualifier>" needs a named thing to check first'}}function X_(e,t,n){if(!["do","does","did","is","are","was","were"].includes(t[0]))return null;let s=t.indexOf("not",1);if(s<0)return null;let o=yr(e.filter((r,i)=>i!==s).join(" "),n);return!o||o.shape!=="ask"?null:{...o,negated:!0}}function J_(e,t,n){let s=$o.find(d=>t.slice(0,d.split(" ").length).join(" ")===d);if(!s)return null;let o=s.split(" ").length;for(;o<t.length&&(t[o]==="the"||t[o]==="a"||t[o]==="all");)o+=1;let r=[];for(;o<t.length&&ct[t[o]];)r.push(t[o]),o+=1;let i=o<t.length?ut(t[o]):null;if(!i)return{node:"miss",reason:"count needs a known entity kind (functions, classes, modules, \u2026)"};let a=t[o];o+=1;let c=e.slice(o),l=t.slice(o).some(d=>!dt.has(d)&&!kb.has(d)),u;if(l){let d=_s(`which ${a} ${c.join(" ")}`,n,1);if(!d||d.node==="miss")return{node:"miss",reason:"the count restrictor didn't parse"};u=d}else u={node:"allOfClass",entityType:i.entityType};return r.length&&(u={node:"qualifier",filters:r,inner:u}),{node:"count",entityType:i.entityType,base:u}}function Z_(e,t,n,s){let o=0,r=!1,i=null;for(let y of Rb){let $=y.split(" ");if(t.slice(0,$.length).join(" ")===y){i=y,o=$.length;break}}if(!i)if(t[0]==="what"||t[0]==="which")r=!0,o=1;else return null;for(;o<t.length&&ud.has(t[o]);)o+=1;let a=[];for(;o<t.length&&ct[t[o]];)a.push(t[o]),o+=1;let c=o<t.length?ut(t[o]):null;if(!c||c.placeholder||c.entityType==="Change")return!r&&o<t.length&&o===t.length-1&&/^[a-z]+$/.test(t[o])&&!me[t[o]]&&!bs.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${_b}`}:null;let l=c.entityType,u=t[o];o+=1;let d=e.slice(o),p=t.slice(o).some(y=>!dt.has(y)&&!kb.has(y)),f=t.slice(o),m=d;(f[0]==="is"||f[0]==="are")&&(f=f.slice(1),m=m.slice(1));let h=r&&Q_.has(f[0]);if(r&&(p&&!h||d.length===0))return null;let g,b=!1;if(p){let y=h?m:d,$=_s(`which ${[...a,u,...y].join(" ")}`,n,(s||0)+1);if(!$||$.node==="miss")return{node:"miss",reason:$&&$.reason||"the list filter didn't parse"};g=$,b=!0}else g={node:"allOfClass",entityType:l},a.length&&(g={node:"qualifier",filters:a,inner:g});return{node:"list",entityType:l,base:g,scoped:b}}function eT(e,t,n){let s=null,o=-1;for(let m=0;m<t.length;m+=1){let h=t.slice(m,m+2).join(" ");if(Hn[h]){s=Hn[h],o=m;break}if(Hn[t[m]]){s=Hn[t[m]],o=m;break}}if(!s)return null;let r=null,i=null;for(let m=o;m<t.length;m+=1)if(qn[t[m]]){r=qn[t[m]],i=t[m];break}if(!r){for(let m=o-1;m>=0;m-=1)if(qn[t[m]]){r=qn[t[m]],i=t[m];break}}let a=t.includes("connected")||t.slice(o,o+2).join(" ")==="most connected"||["largest","biggest","smallest"].includes(t[o]),c=["important","significant","central","key","core","essential","critical","principal"],l=t.some(m=>c.includes(m));!r&&(a||l)&&(r=qn.connections,i="connections");let u,d=null;for(let m of t){let h=ut(m);if(h&&!h.placeholder){u=h.entityType,d=m;break}}if(!d&&(u=i?th[i]:void 0,!u))return{node:"miss",reason:"a superlative needs an entity kind (module, class, function, \u2026)"};if(!r)return{node:"miss",reason:"name what to rank by (imports, callers, methods, tests, or connections)"};let p=["needs","need","needing","lacks","lack","lacking","misses","missing"],f=t.some(m=>p.includes(m))?s==="most"?"fewest":"most":s;return{node:"superlative",entityType:u,metric:r,metricNoun:i,extreme:f}}function nT(e,t,n,s){if(t[0]!=="find")return null;let o=1;for(;o<t.length&&ud.has(t[o]);)o+=1;if(o>=t.length)return null;let r=ut(t[o]);if(r&&!r.placeholder&&r.entityType!=="Change"&&o+1<t.length&&tT.has(t[o+1])){let a=e.slice(o+2).join(" ").trim();if(a)return{node:"find",entityType:r.entityType,term:a}}let i=ut(t[t.length-1]);if(i&&!i.placeholder&&i.entityType!=="Change"){let a=e.slice(o,t.length-1).join(" ").trim();if(a)return{node:"find",entityType:i.entityType,term:a}}return t.some(a=>En.includes(a))?null:o===t.length-1&&/^[a-z]+$/.test(t[o])&&!me[t[o]]&&!bs.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${_b}`}:null}function sT(e,t){if(t[0]!=="find")return null;let n=1;for(;n<t.length&&ud.has(t[n]);)n+=1;let s=-1;for(let i=n+1;i<t.length;i+=1)if(En.includes(t[i])){s=i;break}if(s<0)return null;let o=ut(t[s-1]);if(!o||o.placeholder||o.entityType==="Change")return null;let r=e.slice(n,s-1).join(" ").trim();return r?{entityType:o.entityType,term:r,relIdx:s}:null}function oT(e,t,n,s,o,r){let{branches:i,ops:a}=Xa(n,s),c=null,l=[];for(let u=0;u<i.length;u+=1){let d=i[u],p=d.map(y=>y.toLowerCase()),f=u===0?"intersection":a[u-1],m=Yu(d,p);if(m.blc.length&&m.blc.every(y=>ct[y])){l.push({op:f,kind:"qual",filters:m.blc});continue}if(p[0]==="of"||p[0]==="in"){let y=ld(e,d.slice(1),o,r);if(y.node==="miss")return{miss:y.reason};l.push({op:f,kind:"set",ast:y});continue}let h=d,g=Mt(p,me);g?c=d.slice(g.start,g.end):c&&(h=[...c,...d]);let b=Ab(`${t} ${h.join(" ")}`,o,r);if(!b||b.node==="miss")return{miss:b&&b.reason||"a clause in the combination didn't parse"};l.push({op:f,kind:"set",ast:b})}return{atoms:l}}function Tb(e,t,n,s){let o=sT(e,t);if(o){let{entityType:R,term:w,relIdx:T}=o,I=t.slice(T+1),j=e.slice(T+1);if(!I.length)return{node:"miss",reason:`a relative clause needs a predicate after "${t[T]}"`};let k=oT(R,`which ${t[T-1]}`,I,j,n,s+1);if(k.miss)return{node:"miss",reason:k.miss};let P=[{op:"seed",kind:"set",ast:{node:"find",entityType:R,term:w}},...k.atoms];return P.length===1?P[0].ast:{node:"boolean",entityType:R,atoms:P}}let r=0;for(;r<t.length&&Zs.has(t[r]);)r+=1;let i=r>0,a=[];for(;r<t.length&&ct[t[r]];)a.push(t[r]),r+=1;let c=r<t.length?ut(t[r]):null;if(!c){let R=r+1<t.length?ut(t[r+1]):null;if(nb.has(t[r])&&R&&R.entityType==="Commit"&&r+2===t.length)return{node:"recentCommits"};if(rd.has(t[r])){let w=r+1;w<t.length&&(t[w]==="the"||t[w]==="a"||t[w]==="an")&&(w+=1);let T=w+1<t.length?ut(t[w+1]):null;if(nb.has(t[w])&&T&&T.entityType==="Commit"&&w+2===t.length)return{node:"recentCommits"}}return(i||a.length)&&R&&/^[a-z]+$/.test(t[r])&&!me[t[r]]&&!dt.has(t[r])&&!wd.has(t[r])?{node:"find",entityType:R.entityType,term:e[r]}:null}let l=c.entityType,u=t[r];r+=1;let d=t.slice(r),p=e.slice(r),f=!1;d.length&&En.includes(d[0])&&(f=!0,d=d.slice(1),p=p.slice(1));let m=d[0]==="of"||d[0]==="in",h=d.length>0&&$b(d[0]),g=p.length>0&&Xa(d,p).branches.some(R=>{let{blc:w}=Yu(R,R.map(T=>T.toLowerCase()));return w.length&&w.every(T=>ct[T])}),b=p.length>0?Xa(d,p).branches:[],y=!1;if(b.length>1){let R=b[0].map(T=>T.toLowerCase()),w=Mt(R,me);w&&w.start===0&&(y=b.slice(1).every(T=>{let I=T.map(k=>k.toLowerCase()),j=Mt(I,me);return j&&j.start===0?j.kind===w.kind:!j}))}let $=!1;if(b.length>1){let R=b[0].map(T=>T.toLowerCase()),w=Mt(R,me);w&&w.start===0&&($=b.slice(1).every(T=>{let I=T.map(k=>k.toLowerCase()),j=Mt(I,me);return!!j&&j.start===0&&j.end-j.start===1}))}if(!(a.length||f||m||h||g||y||$))return null;if(!p.length){let R={node:"allOfClass",entityType:l};return a.length?{node:"qualifier",filters:a,inner:R,entityType:l}:{node:"miss",reason:"nothing to filter or traverse"}}let E=c.placeholder?"what":`which ${u}`,{branches:_,ops:v}=Xa(d,p),S=null,C=[];for(let R=0;R<_.length;R+=1){let w=_[R],T=w.map(H=>H.toLowerCase()),I=R===0?"seed":v[R-1],j=Yu(w,T);if(j.blc.length&&j.blc.every(H=>ct[H])){C.push({op:I,kind:"qual",filters:j.blc});continue}if(T[0]==="of"||T[0]==="in"){let H=ld(l,w.slice(1),n,s+1);if(H.node==="miss")return H;C.push({op:I,kind:"set",ast:H});continue}let k=w,P=Mt(T,me);P?S=w.slice(P.start,P.end):S&&(k=[...S,...w]);let U=Ab(`${E} ${k.join(" ")}`,n,s+1);if(!U||U.node==="miss")return{node:"miss",reason:U&&U.reason||"a clause in the combination didn't parse"};C.push({op:I,kind:"set",ast:U})}if(C[0].kind!=="set")return{node:"miss",reason:"start with a clause, then combine with and/or/but-not"};let x;return C.length===1?x=C[0].ast:x={node:"boolean",entityType:l,atoms:C},a.length&&(x={node:"qualifier",filters:a,inner:x,entityType:l}),x}function Ab(e,t,n){if(n>yb)return{node:"miss",reason:"too deep to resolve"};let s=sn(e),o=s.map(a=>a.toLowerCase()),r=ad(s,o,t,n);if(r)return r;let i=yr(e,t);return i?{node:"clause",clause:i}:null}function Xa(e,t){let n=Object.keys(sr).sort((a,c)=>c.split(" ").length-a.split(" ").length),s=[],o=[],r=0,i=0;for(;i<e.length;){let a=null;for(let c of n){let l=c.split(" ");if(e.slice(i,i+l.length).join(" ")===c){a={c,len:l.length};break}}a&&i>r?(s.push(t.slice(r,i)),o.push(sr[a.c]),i+=a.len,r=i):a?(i+=a.len,r=i):i+=1}return s.push(t.slice(r)),{branches:s,ops:o}}function Cb(e){let t=sb.get(e);if(t)return t;t=new Map;for(let n of e.individuals||[])n.class==="Module"&&t.set(jn(n.label),n);return sb.set(e,t),t}function Ib(e,t){let n=Cb(e),s=[];for(let o of t){let r=e.byId.get(o);if(!r||r.class==="Module")continue;let i=Co(r),a=i?n.get(jn(i)):null;a&&s.push(a)}return bn(s)}function iT(e){let t=ob.get(e);if(t)return t;t=new Map;let n=Cb(e);for(let s of e.individuals||[]){if(s.class==="Module")continue;let o=Co(s),r=o?n.get(jn(o)):null;r&&(t.has(r.id)||t.set(r.id,[]),t.get(r.id).push(s))}return ob.set(e,t),t}function dd(e,t,n,s){let o=wr[t];if(o&&Js.has(n)){let d=Qe(e,o).filter(p=>s.has(p.object));return bn(d.map(p=>e.byId.get(p.subject)).filter(p=>p&&p.class===n))}let a=(!!o&&[...s].some(d=>Js.has(e.byId.get(d)?.class))?[...At(t),o]:At(t)).flatMap(d=>Qe(e,d)),c=a.filter(d=>s.has(d.object));t==="cochange"&&(c=c.concat(a.filter(d=>s.has(d.subject)).map(d=>({...d,subject:d.object,object:d.subject}))));let l=bn(c.map(d=>e.byId.get(d.subject)).filter(Boolean));if(!n||n==="Change")return l;let u=l.filter(d=>d.class===n);if(Ob(t,n)){let d=new Set(c.map(f=>f.object)),p=new Set([...s].filter(f=>!d.has(f)));return bn([...u,...Ib(e,p)])}return u.length?u:n!=="Module"&&l.some(d=>d.class==="Module")?hd(e,new Set(l.filter(d=>d.class==="Module").map(d=>d.id)),n):[]}function cT(e){let t=new Set;for(let n of["touches","touchesSymbol"])for(let s of Qe(e,n)){let o=e.byId.get(s.subject);o?.class==="Commit"&&t.add(String(o.label||"").toLowerCase())}return e.individuals.filter(n=>n.class==="Commit").map(n=>String(n.label||"").toLowerCase()).filter(n=>n&&!t.has(n)).sort()}function lT(e,t){let n=new Set(dd(e,"touches","Commit",t).map(o=>String(o.label||"").toLowerCase())),s=cT(e);for(let o of t)for(let r of e.byId.get(o)?.derived_from||[]){let i=aT.exec(String(r||""));if(!i)continue;let a=i[1].toLowerCase(),c=s.find(l=>l.startsWith(a)||a.startsWith(l));c&&n.add(c)}return n.size}function wi(e,t,n){let s=At(t).flatMap(o=>Qe(e,o)).filter(o=>n.has(o.subject));return bn(s.map(o=>e.byId.get(o.object)).filter(Boolean))}function bn(e){let t=new Set,n=[];for(let s of e)s&&!t.has(s.id)&&(t.add(s.id),n.push(s));return n}function uT(e,t){let n=jn(t);if(!n)return[];let s=`${n}/`;return e.individuals.filter(o=>o.class==="Module"&&jn(o.label).startsWith(s))}function Xu(e){let t=rb.get(e);if(t)return t;let n=new Set;for(let i of Qe(e,"reexports")){n.add(String(i.object).toLowerCase());let a=e.byId.get(i.object);a&&n.add(String(a.label).toLowerCase())}let s=new Set,o=new Set;for(let i of Qe(e,"tests"))s.add(i.object),o.add(i.subject);let r=new Map;for(let i of Qe(e,"defines"))r.set(i.object,i.subject);return t={exported:n,testedModules:s,testModules:o,moduleOfSymbol:r},rb.set(e,t),t}function Ao(e,t){return t?t.class==="Module"?t.id:Xu(e).moduleOfSymbol.get(t.id)||null:null}function Nb(e,t){let n=String(t||"").trim().toLowerCase();if(!n)return null;let s=(e?.individuals||[]).filter(d=>dT.has(d.class)&&String(d.label).toLowerCase()===n);if(s.length!==1)return null;let o=s[0],r=Ao(e,o),i=r&&e.byId.get(r)?.label||String((o.attributes||[]).find(d=>d.key==="site")?.value||"").split(":")[0]||null,a=Te(o.class,1),c=a==="attribute"?"an":"a",l=i?`, ${hi("defined-in",o.id,"defined in")} ${i}`:"",u=o.class==="Class"?` or "which classes inherit from ${o.label}"`:"";return{text:`${o.label} is ${c} ${a} in this codebase${l} \u2014 try "describe ${o.label}"${u}.`,hit:o,modLabel:i}}function Qa(e,t,n){let s=bn(or.flatMap(i=>wi(e,i,new Set([t])))),o=n?s.filter(i=>i.class===n):s;if(o.length)return o;let r=iT(e).get(t)||[];return n?r.filter(i=>i.class===n):r}function fd(e,t,n=null){let s=Rs(e,t,n);if(!(s.match&&s.tier===1)){let o=uT(e,t);if(o.length)return{kind:"dir",mods:o}}return s.match?{kind:"single",id:s.match.id,entityClass:s.match.class,label:s.match.label}:{kind:"miss"}}function Lb(e,t,n,s,o){let r=o||(()=>!0),i=Qa(e,t,s).filter(r);if(i.length||!Mb(e,n))return{own:i,inherited:[],viaId:null,viaLabel:null};for(let a of Pb(e,t)){let c=e.byId.get(a);if(!c)continue;let l=Qa(e,a,s).filter(r);if(l.length)return{own:i,inherited:l,viaId:a,viaLabel:c.label}}return{own:i,inherited:[],viaId:null,viaLabel:null}}function Ro(e,t,n){if(!n)return!1;switch(n.via){case"visibility":return String((t.attributes||[]).find(o=>o.key==="visibility")?.value||"public").toLowerCase()===n.value;case"attr":return!!(t.attributes||[]).find(s=>s.key===n.attr)?.value;case"exported":{let s=Xu(e).exported;return s.has(String(t.label).toLowerCase())||s.has(String(t.id).toLowerCase())}case"tested":{let s=Ao(e,t),o=Xu(e),r=s?e.byId?.get?.(s):null;return s&&(o.testModules.has(s)||r&&Eo(String(r.label).toLowerCase()))?!1:(!!s&&o.testedModules.has(s))===n.value}default:return!1}}function pd(e){return Qe(e,"inherits")}function Ju(e,t){return pd(e).filter(n=>n.object===t).map(n=>n.subject)}function ib(e,t){return pd(e).filter(n=>n.subject===t).map(n=>n.object)}function fT(e,t){let n=new Set,s=[...Ju(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of Ju(e,o))n.has(r)||s.push(r)}}return n}function Pb(e,t){let n=new Set,s=[...ib(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of ib(e,o))n.has(r)||s.push(r)}}return n}function Mb(e,t){let n=ab.get(e);if(n||(n=new Map,ab.set(e,n)),n.has(t))return n.get(t);let s=pd(e).some(o=>{let r=e.byId.get(o.subject),i=e.byId.get(o.object);return!!r&&!!i&&r.class===t&&i.class===t});return n.set(t,s),s}function cb(e,t){let n=String(e.label||"").toLowerCase();if(t.every(o=>n.includes(o)))return"label";let s=(e.attributes||[]).map(o=>String(o.value??"").toLowerCase());return t.every(o=>s.some(r=>r.includes(o)))?"attr":null}function ub(e){return e.slice().sort((t,n)=>lb[n.via]-lb[t.via]||String(t.ind.label).length-String(n.ind.label).length).map(t=>t.ind)}function db(e,t){let n=String(t||"").trim().toLowerCase();if(n.length<4)return!1;let s=Ss(n);if(Es(String(e.label||"").toLowerCase(),n,s)<=s)return!0;for(let o of _o(e.label))if(Es(o,n,s)<=s)return!0;return!1}function Fb(e,t,n){let s=e.individuals.filter(c=>c.class===t),o=[..._o(n)];if(!o.length||!s.length)return{narrow:[],broad:[]};let r=Mb(e,t),i=[];for(let c of s){let l=cb(c,o);if(l){i.push({ind:c,via:l});continue}if(!r)continue;[...fT(e,c.id)].some(d=>{let p=e.byId.get(d);return!!p&&!!cb(p,o)})&&i.push({ind:c,via:"chain"})}if(i.length||!r)return{narrow:ub(i),broad:[]};let a=new Map;for(let c of s)for(let l of Pb(e,c.id)){if(!a.has(l)){let u=e.byId.get(l);u&&u.class===t&&db(u,n)&&a.set(l,{ind:u,via:"chain"})}for(let u of Ju(e,l)){if(u===c.id||a.has(u))continue;let d=e.byId.get(u);d&&d.class===t&&db(d,n)&&a.set(u,{ind:d,via:"chain"})}}return{narrow:[],broad:ub([...a.values()])}}function pT(e){return[...Na(La(e)).entries()].sort((t,n)=>n[1]-t[1]||t[0].localeCompare(n[0])).map(([t])=>({id:`pkg:${t}`,label:t,class:"Package"}))}function Yt(e,t,n){switch(t.node){case"clause":return on(e,t.clause,n).matches||[];case"allOfClass":return t.entityType==="Package"?pT(e):e.individuals.filter(s=>s.class===t.entityType);case"find":{let{narrow:s,broad:o}=Fb(e,t.entityType,t.term);return s.length?s:o}case"existsEdge":{let s=new Set(At(t.kind).flatMap(o=>Qe(e,o)).map(o=>o.subject));return e.individuals.filter(o=>s.has(o.id)&&(!t.entityType||o.class===t.entityType))}case"forwardComplement":{let s=Rs(e,t.subjectTerm,n&&n.contextId);if(!s.match)return[];let o=xb(e,t.kind);if(!o)return[];let r=new Set(wi(e,t.kind,new Set([s.match.id])).map(i=>i.id));return e.individuals.filter(i=>i.class===o&&!r.has(i.id))}case"commitFilter":return Qu(e,t).matches;case"reverseSet":{let s=new Set(Yt(e,t.inner,n).map(o=>o.id));return dd(e,t.kind,t.entityType,s)}case"forwardSet":{let s=new Set(Yt(e,t.inner,n).map(o=>o.id));return wi(e,t.kind,s)}case"prevSet":{let s=n&&n.prev;return Array.isArray(s)?s.map(o=>e.byId.get(o)).filter(Boolean):[]}case"membership":{let s=fd(e,t.term,n&&n.contextId);if(s.kind==="dir"){if(!t.entityType||t.entityType==="Module")return s.mods;let i=new Set(s.mods.map(c=>c.id));return bn(or.flatMap(c=>wi(e,c,i))).filter(c=>c.class===t.entityType)}if(s.kind==="miss")return[];let{own:o,inherited:r}=Lb(e,s.id,s.entityClass,t.entityType);return o.length?o:r}case"membershipSet":{let s=Yt(e,t.inner,n);return s.length?bn(s.flatMap(o=>Qa(e,o.id,t.entityType))):[]}case"qualifier":return t.inner.node==="membership"?Bb(e,t,n).matches:Yt(e,t.inner,n).filter(o=>t.filters.every(r=>Ro(e,o,ct[r])));case"boolean":return Db(e,t,n);case"anaphora":return zb(e,t,n).matches;default:return[]}}function Db(e,t,n){let s=[];for(let o of t.atoms){if(o.op==="seed"){s=Yt(e,o.ast,n);continue}if(o.kind==="qual"){let i=c=>o.filters.every(l=>Ro(e,c,ct[l])),a=c=>o.filters.every(l=>{let u=mT(ct[l]);return u?Ro(e,c,u):!Ro(e,c,ct[l])});s=o.op==="difference"?s.filter(a):s.filter(i);continue}let r=new Set(Yt(e,o.ast,n).map(i=>i.id));if(o.op==="intersection")s=s.filter(i=>r.has(i.id));else if(o.op==="difference")s=s.filter(i=>!r.has(i.id));else if(o.op==="union"){let i=new Set(s.map(a=>a.id));for(let a of Yt(e,o.ast,n))i.has(a.id)||(i.add(a.id),s.push(a))}}return s}function hT(e,t){if(!Array.isArray(t)||t.length<2)return null;let n=new Set,s=[];for(let o of t){let r=wn(e,o);r&&r.match&&!n.has(r.match.id)&&(n.add(r.match.id),s.push(r.match))}return s.length>=2?s:null}function zb(e,t,n){let o=hT(e,t.candidateTerms);if(!o){let d=n&&n.prev;if(!Array.isArray(d)||!d.length)return{compositeMiss:!0,reason:"no-prev",matches:[]};o=d.map(p=>e.byId.get(p)).filter(Boolean)}let r=o,i=t.filter;if(i&&i.type==="qual")r=r.filter(d=>i.filters.every(p=>Ro(e,d,ct[p])));else if(i&&i.type==="entity")r=r.filter(d=>d.class===i.entityType);else if(i&&i.type==="clause"){let d=wn(e,i.clause.object);if(!d.match)r=[];else{let p=wr[i.clause.kind],f=[...At(i.clause.kind),...p?[p]:[]],m=new Set(f.flatMap(h=>Qe(e,h)).filter(h=>h.object===d.match.id).map(h=>h.subject));r=r.filter(h=>m.has(h.id))}}let a=d=>d.length&&d.every(p=>p.class===d[0].class)?d[0].class:null,c=i&&i.type==="entity"?i.entityType:a(o),l=r.length?a(r):c;if(t.mode==="count")return{compositeKind:"count",count:r.length,entityType:l,matches:[]};let u=vi(l,r,"anaphora",{bound:!0});return{compositeKind:"set",matches:r,entityType:l,referents:u}}function Ub(e,t,n){let s=n.kind==="*"?gT:[n.kind,...n.sibling?[n.sibling]:[]],o=0;for(let r of s)for(let i of Qe(e,r)){let a=i.subject===t.id,c=i.object===t.id;if(n.dir==="out"&&a){if(n.filter){let l=e.byId.get(i.object);if(!l||l.class!==n.filter)continue}o+=1}else(n.dir==="in"&&c||n.dir==="both"&&(a||c))&&(o+=1)}return o}function bT(e){let t=e.individuals.filter(s=>s.class==="Commit"),n=s=>String((s.attributes||[]).find(o=>o.key==="date")?.value||"");return t.sort((s,o)=>n(o).localeCompare(n(s))),{compositeKind:"recentCommits",matches:t}}function Qu(e,t){let{op:n,pivotRaw:s,entityType:o=null}=t,r=f=>String((f.attributes||[]).find(m=>m.key==="date")?.value||"").slice(0,10),i=null,a=null,c=null;if(wT.test(s))i=s;else{let{match:f,ambiguous:m}=wn(e,s,{expectedClass:"Commit"});f&&!m&&f.class==="Commit"&&r(f)&&(a=f.id,c=f.label,i=r(f))}if(!i)return{compositeKind:"commitFilter",op:n,pivotRaw:s,entityType:o,pivotResolved:!1,matches:[]};let l=e.individuals.filter(f=>f.class==="Commit"&&f.id!==a&&r(f)).filter(f=>{let m=r(f);return n==="since"?m>=i:n==="before"?m<i:n==="after"?m>i:m===i}).sort((f,m)=>r(m).localeCompare(r(f))||String(f.id).localeCompare(String(m.id))),u=o&&o!=="Commit"&&o!=="Change"?bn(l.flatMap(f=>Gb(e,f,o).matches)):null,d=u||l,p=[];if(d.length){let f=u?o:"Commit";p.push({kind:"set",class:f,label:`${d.length} ${Te(f,d.length)} ${n} ${s}`,ids:d.map(m=>m.id),attrs:{count:d.length,op:n,...a?{pivot:a}:{}},lane:"commitFilter"})}return a&&p.push({kind:"event",class:"Commit",label:c,ids:[a],attrs:{date:i},lane:"commitFilter"}),{compositeKind:"commitFilter",op:n,pivotRaw:s,pivotDate:i,pivotResolved:!0,entityType:o,windowCount:l.length,matches:d,referents:p}}function yT(e,t,n){let s=Yt(e,t.inner,n),o=new Set(s.map(a=>a.id));if(!o.size)return{compositeKind:"temporal",matches:[],entityType:t.entityType,innerCount:0};let r=dd(e,"touches","Commit",o),i=a=>String((a.attributes||[]).find(c=>c.key==="date")?.value||"");return r.sort((a,c)=>i(c).localeCompare(i(a))),{compositeKind:"temporal",matches:r,entityType:t.entityType,innerCount:s.length}}function $T(e,t,n){let s=Yt(e,t.inner,n);return{compositeKind:"whereSet",matches:s,entityType:t.entityType,sites:s.map(o=>(o.attributes||[]).find(r=>r.key==="site")?.value||null)}}function vT(e,t){let n=e.individuals.filter(a=>a.class===t.entityType);if(t.metric?.kind==="tests"&&t.entityType==="Module"){let a=new Set(Qe(e,"tests").map(c=>c.subject));n=n.filter(c=>!a.has(c.id)&&!Eo(String(c.label).toLowerCase()))}let s=n.map(a=>({ind:a,score:Ub(e,a,t.metric)})).sort((a,c)=>t.extreme==="most"?c.score-a.score:a.score-c.score);if(!s.length)return{compositeKind:"superlative",entityType:t.entityType,matches:[]};let o=s[0].score,r=s.filter(a=>a.score===o).map(a=>a.ind),i=r.length>=2?vi(t.entityType,r,"superlative"):[{kind:"entity",class:t.entityType,label:r[0].label,ids:[r[0].id],attrs:{},lane:"superlative"}];return i.push({kind:"measure",label:`${o} ${t.metricNoun}`,ids:[],attrs:{metric:o},lane:"superlative"}),{compositeKind:"superlative",entityType:t.entityType,metricNoun:t.metricNoun,extreme:t.extreme,score:o,matches:r,referents:i}}function Bb(e,t,n){let s=t.node==="qualifier"&&t.inner.node==="membership"?t:null,o=s?s.inner:t,r=o.entityType,i=s?m=>s.filters.every(h=>Ro(e,m,ct[h])):null,a=m=>vi(r,m,"membership"),c=fd(e,o.term,n&&n.contextId);if(c.kind==="dir"){let m;if(!r||r==="Module")m=c.mods;else{let h=new Set(c.mods.map(g=>g.id));m=bn(or.flatMap(g=>wi(e,g,h))).filter(g=>g.class===r)}return i&&(m=m.filter(i)),{compositeKind:"set",matches:m,entityType:r,referents:a(m)}}if(c.kind==="miss")return{compositeKind:"set",matches:[],entityType:r};let{own:l,inherited:u,viaLabel:d}=Lb(e,c.id,c.entityClass,r,i),p=!l.length&&u.length>0,f=p?u:l;return{compositeKind:"membership",entityType:r,matches:f,inheritedNotOwn:p,viaLabel:d,ownerLabel:c.label,referents:a(f)}}function xT(e,t){let{entityType:n,term:s,scopeModule:o}=t,r=null;if(o){let a=wn(e,o,{expectedClass:"Module"});if(!a.match)return{compositeKind:"exists",entityType:n,term:s,scopeModule:o,scopeMiss:!0,matches:[]};r=a.match}if(s){let a=wn(e,s,{expectedClass:n}),c=!r||a.match&&Ao(e,a.match)===r.id,l=a.match&&c;return{compositeKind:"exists",entityType:n,term:s,scopeModule:o,scopeMatch:r,matches:l?[a.match]:[]}}let i=r?hd(e,new Set([r.id]),n):e.individuals.filter(a=>a.class===n);return{compositeKind:"exists",entityType:n,term:null,scopeModule:o,scopeMatch:r,matches:i}}function ET(e,t,n){let s=Ao(e,t);return n.kind==="dir"?n.mods.some(o=>o.id===t.id||o.id===s):s===n.id||Qa(e,n.id).some(o=>o.id===t.id)}function ST(e,t,n){let{term:s,qualifier:o,negated:r,scope:i}=t,a=Rs(e,s,n.contextId);if(a.unresolvedPronoun)return{compositeKind:"qualCheck",qualCheckMiss:"pronoun",term:s,matches:[]};if(!a.match)return{compositeKind:"qualCheck",qualCheckMiss:"unresolved",term:s,matches:[]};if(i){let d=fd(e,i,n.contextId);if(d.kind==="miss")return{compositeKind:"qualCheck",qualCheckMiss:"scope",term:s,scope:i,matches:[]};if(!ET(e,a.match,d))return{compositeKind:"qualCheck",qualCheckMiss:"outsideScope",term:s,scope:i,subjectLabel:a.match.label,scopeLabel:d.kind==="dir"?i:d.label,matches:[]}}let c=Ro(e,a.match,ct[o]),l=r?!c:c,u=[{kind:"entity",class:a.match.class,label:a.match.label,ids:[a.match.id],attrs:{},lane:"qualCheck"}];return{compositeKind:"qualCheck",subject:a.match,qualifier:o,negated:r,holds:l,matches:[a.match],referents:u}}function jT(e,t,n){let s=wn(e,t.object);if(!s||!s.match)return{compositeKind:"universal",universalMiss:"unresolved",object:t.object,matches:[]};let o=Yt(e,{node:"allOfClass",entityType:t.entityType},n),r=Db(e,t.complement,n),i=r.length===0;return{compositeKind:"universal",entityType:t.entityType,kind:t.kind,object:s.match.label,holds:i,total:o.length,counter:r,matches:i?o:r}}function kT(e,t,n){if(t.node==="reverseSet"&&t.kind==="touches"&&t.entityType==="Commit")return new Set(Yt(e,t.inner,n).map(s=>s.id));if(t.node==="clause"&&t.clause?.shape==="reverse"&&t.clause.kind==="touches"&&t.clause.entityType==="Commit"){let{objMatch:s,ambiguous:o}=on(e,t.clause,n);return s&&!o?new Set([s.id]):null}return null}function RT(e,t,n={}){if(t.node==="miss")return{compositeMiss:!0,reason:t.reason||null,matches:[]};if(t.node==="exists")return xT(e,t);if(t.node==="qualCheck")return ST(e,t,n);if(t.node==="universal")return jT(e,t,n);if(t.node==="count"){if(t.base.node==="commitFilter"){let c=Qu(e,t.base);return c.pivotResolved?{compositeKind:"count",count:c.matches.length,entityType:t.entityType,matches:[]}:c}let a=kT(e,t.base,n);return a?{compositeKind:"count",count:lT(e,a),entityType:t.entityType,matches:[]}:{compositeKind:"count",count:Yt(e,t.base,n).length,entityType:t.entityType,matches:[]}}if(t.node==="list")return{compositeKind:"list",matches:Yt(e,t.base,n),entityType:t.entityType,scoped:t.scoped};if(t.node==="worldRelation")return uA(e,t);if(t.node==="superlative")return vT(e,t);if(t.node==="temporal")return yT(e,t,n);if(t.node==="whereSet")return $T(e,t,n);if(t.node==="recentCommits")return bT(e);if(t.node==="commitFilter")return Qu(e,t);if(t.node==="anaphora")return zb(e,t,n);if(t.node==="membership"||t.node==="qualifier"&&t.inner.node==="membership")return Bb(e,t,n);if(t.node==="find"){let{narrow:a,broad:c}=Fb(e,t.entityType,t.term);return{compositeKind:"find",entityType:t.entityType,term:t.term,matches:a.length?a:c,broad:!a.length&&c.length>0}}if((t.node==="reverseSet"||t.node==="forwardSet")&&t.inner.node==="prevSet"&&!(Array.isArray(n.prev)&&n.prev.length))return{compositeMiss:!0,reason:"no-prev",matches:[]};let s=Yt(e,t,n),o=t.entityType||null,r=vi(o,s,t.node==="qualifier"?"qualifierListing":"compositeSet"),i=s.length?null:_T(e,t,n);return{compositeKind:"set",matches:s,entityType:o,referents:r,...i?{narrowedFrom:i}:{}}}function _T(e,t,n){if(t.node!=="boolean"||t.atoms?.length!==2)return null;let[s,o]=t.atoms;if(s.op!=="seed"||o.op!=="intersection"||o.kind!=="qual")return null;let r=s.ast?.node==="clause"?s.ast.clause:null;if(!r?.kind||!r.object||r.modifier==="transitive")return null;let i=Yt(e,s.ast,n);return i.length?{count:i.length,entityType:r.entityType||t.entityType||null,kind:r.kind,object:r.object,filters:o.filters}:null}function Zu(){return'compositional queries also work: "which functions call X and call Y", "what calls something that imports X", "public methods of X", "list functions" / "show me the classes", "how many classes", "which module has the most imports", "find me the payment class", or (after a listing) "which of those are tested"'}function TT(e){let t=["Function","Method"].includes(e.class)?`${e.label}()`:e.label;if(e.class==="Module")return t;let n=Co(e);return n?`${t} in ${n}`:t}function ed(e){return!e||typeof e!="object"?!1:Array.isArray(e)?e.some(ed):Array.isArray(e.filters)&&e.filters.some(t=>ct[String(t).toLowerCase()]?.via==="tested")?!0:Object.values(e).some(ed)}function AT(e,t){return!["Function","Method"].includes(t)||!ed(e)?null:"This index records tests edges module to module, so it holds no function-grain coverage to filter on \u2014 ask whether the module a function lives in is tested instead."}function CT(e,t,n){if(t.compositeMiss)return t.reason==="no-prev"?{content:'"those"/"them" needs a previous answer to refer to \u2014 ask a listing question first, then follow up.',miss:!0,ambiguous:!1}:{content:`couldn't compile this compositional question${t.reason?` (${t.reason})`:""}. ${Zu()}.`,miss:!0,ambiguous:!1};if(t.compositeKind==="exists"){if(t.scopeMiss)return{content:`no module matching "${t.scopeModule}" found in the index.`,miss:!0,ambiguous:!1};let s=Te(t.entityType,1),o=Te(t.entityType,2),r=t.scopeMatch?` in ${t.scopeMatch.label}`:"";if(t.term){if(!t.matches.length)return{content:`No \u2014 no ${s} named "${t.term}" found${r}.`,miss:!0,ambiguous:!1};let i=t.matches[0],a=Co(i),c=i.class==="Module"?"":a?`, ${hi("defined-in",i.id,"defined in")} ${a}`:"";return{content:`Yes \u2014 ${i.label} is a ${s}${c}.`,miss:!1,ambiguous:!1,matches:t.matches}}return t.matches.length?{content:`Yes \u2014 ${js(t.matches)}${r}.`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`No \u2014 no ${o} found${r}.`,miss:!0,ambiguous:!1}}if(t.compositeKind==="qualCheck"){if(t.qualCheckMiss==="pronoun")return{content:`"${t.term}" needs a selected node to refer to \u2014 click a node first, or name it directly.`,miss:!0,ambiguous:!1};if(t.qualCheckMiss==="unresolved")return{content:`couldn't find "${t.term}" in the index to check.`,miss:!0,ambiguous:!1};if(t.qualCheckMiss==="scope")return{content:`couldn't find "${t.scope}" in the index to check inside.`,miss:!0,ambiguous:!1};if(t.qualCheckMiss==="outsideScope")return{content:`No \u2014 ${t.subjectLabel} isn't in ${t.scopeLabel}.`,miss:!0,ambiguous:!1};let s=t.subject.label,o=t.negated?`not ${t.qualifier}`:t.qualifier,r=t.negated?t.qualifier:`not ${t.qualifier}`;return{content:`${t.holds?"Yes":"No"} \u2014 ${s} is ${t.holds?o:r}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="universal"){if(t.universalMiss==="unresolved")return{content:`couldn't find "${t.object}" in the index to check.`,miss:!0,ambiguous:!1,matches:[]};let s=Te(t.entityType,t.total),o=g_(t.kind);return t.holds?{content:`Yes \u2014 all ${t.total} ${s} ${o} ${t.object}.`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`No \u2014 ${t.counter.length} of ${t.total} ${s} do not ${o} ${t.object}: ${js(t.counter)}.`,miss:!1,ambiguous:!1,matches:t.counter}}if(t.compositeKind==="count"){let s=t.entityType?Te(t.entityType,t.count):t.count===1?"result":"results";return{content:`${t.count} ${s}.`,miss:!1,ambiguous:!1,matches:[]}}if(t.compositeKind==="list"){if(!t.matches.length)return{content:`no ${Te(t.entityType,2)} in this index.`,miss:!0,ambiguous:!1,matches:[]};let s=!["Module","Package","Commit","Fact","Utterance","Session","Source","Rule"].includes(t.entityType),o=!t.scoped&&s&&t.matches.length>rt?` \u2014 narrow with "${Te(t.entityType,2)} in <module>"`:"";return{content:`${js(t.matches)}${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="worldRelation"){let s=gn(t.asked),o=bo[t.relation].nouns[1];return t.pairs.length?{content:`${t.pairs.map(i=>`${i.subject.label||i.subject.id} ${i.reads} ${i.object}`).join("; ")}.`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`no ${o} on record for ${s} in this graph.`,miss:!0,ambiguous:!1,matches:[]}}if(t.compositeKind==="membership"){if(!t.matches.length)return{content:`nothing in the index matches that${t.entityType?` (${Te(t.entityType,2)})`:""}. ${Xs(n)}`,miss:!0,ambiguous:!1,matches:[]};if(t.inheritedNotOwn){let s=Te(t.entityType,2);return{content:`${t.ownerLabel?`${t.ownerLabel} has no own ${s}`:`no own ${s}`} \u2014 inherited from ${t.viaLabel}: ${js(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches,inheritedNotOwn:!0}}return{content:`${js(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="find"){let s=Te(t.entityType,1);if(!t.matches.length)return{content:`no ${Te(t.entityType,2)} found matching "${t.term}".`,miss:!0,ambiguous:!1,matches:[]};let o=t.matches.length===1?TT(t.matches[0]):js(t.matches);return t.broad?{content:`no exact ${s} named "${t.term}", but found a related ${t.matches.length===1?s:Te(t.entityType,2)}: ${o}.`,miss:!1,ambiguous:!1,matches:t.matches,relatedNotExact:!0}:{content:`${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="recentCommits"){if(!t.matches.length)return{content:"no commits recorded in this index.",miss:!0,ambiguous:!1,matches:[]};let s=i=>String((i.attributes||[]).find(a=>a.key==="date")?.value||""),o=t.matches.slice(0,nn).map(i=>{let a=s(i).slice(0,10),c=(i.attributes||[]).find(l=>l.key==="message")?.value||"";return`${i.label}${a?` (${a})`:""}${c?` \u2014 ${c}`:""}`}),r=t.matches.length>nn?` \u2026+${t.matches.length-nn} more`:"";return{content:`${t.matches.length} recent commit(s): ${o.join(", ")}${r}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="commitFilter"){if(!t.pivotResolved)return{content:`"${t.pivotRaw}" isn't a recognized date (yyyy-mm-dd) or a known commit \u2014 try "what changed since 2026-06-01" or "what changed before <commit>".`,miss:!0,ambiguous:!1,matches:[]};if(!t.windowCount)return{content:`no commits recorded ${t.op} ${t.pivotRaw}.`,miss:!0,ambiguous:!1,matches:[]};if(t.entityType&&t.entityType!=="Commit"&&t.entityType!=="Change"){let i=Te(t.entityType,t.matches.length||2);return t.matches.length?{content:`${js(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`no ${i} changed ${t.op} ${t.pivotRaw}.`,miss:!0,ambiguous:!1,matches:[]}}let s=i=>String((i.attributes||[]).find(a=>a.key==="date")?.value||""),o=t.matches.slice(0,nn).map(i=>{let a=s(i).slice(0,10),c=(i.attributes||[]).find(l=>l.key==="message")?.value||"";return`${i.label}${a?` (${a})`:""}${c?` \u2014 ${c}`:""}`}),r=t.matches.length>nn?` \u2026+${t.matches.length-nn} more`:"";return{content:`${t.matches.length} commit(s) changed ${t.op} ${t.pivotRaw}: ${o.join(", ")}${r}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="superlative"){if(!t.matches.length)return{content:`no ${Te(t.entityType,2)} to rank in this index.`,miss:!0,ambiguous:!1};let s=t.extreme==="most"?"the most":"the fewest",o=t.matches.length>1?` (${t.matches.length}-way tie)`:"";return{content:`${js(t.matches)} \u2014 ${s} ${t.metricNoun} (${t.score})${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="temporal"){let s=t.innerCount||0,o=t.entityType?Te(t.entityType,s||2):s===1?"entity":"entities",r=s===1?"was":"were";if(!s)return{content:`nothing in the index matches the inner set, so there is no change history to date. ${Xs(n)}`,miss:!0,ambiguous:!1,matches:[]};if(!t.matches.length)return{content:`no recorded commit touched the ${s} ${o} in that set in this index. ${Xs(n)}`,miss:!0,ambiguous:!1,matches:[]};let i=t.matches[0],a=(i.attributes||[]).find(d=>d.key==="date")?.value||"";if(!a)return{content:`the ${o} in that set ${r} last touched by commit ${i.label}, but this index records no commit dates \u2014 regenerate the graph to attach mgx:commitDate.`,miss:!0,ambiguous:!1,matches:t.matches};let c=(i.attributes||[]).find(d=>d.key==="message")?.value||"",l=String(a).slice(0,10),u=t.matches.length-1;return{content:`the ${o} in that set ${r} last touched by commit ${i.label} on ${l}${c?` ("${c}")`:""}${u?`; ${u} earlier commit${u===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="whereSet"){let s=t.entityType?Te(t.entityType,2):"entities";if(!t.matches.length)return{content:`nothing in the index matches that clause (${s}), so there is no location to cite. ${Zu()}.`,miss:!0,ambiguous:!1,matches:[]};let o=t.matches.map((i,a)=>td(i,t.sites[a])||`${i.label} has no recorded code location in this index.`),r=t.matches.filter((i,a)=>td(i,t.sites[a]));return{content:o.join(" "),miss:r.length===0,ambiguous:!1,matches:t.matches}}if(!t.matches.length){let s=AT(e,t.entityType),o=s?null:t.narrowedFrom;if(o){let i=Te(o.entityType||"Module",2);return{content:`${o.count===1?`1 ${Te(o.entityType||"Module",1)} ${Qs(o.kind)} ${o.object}, but it is not ${gn(o.filters)}`:`${o.count} ${i} ${$i(o.kind)} ${o.object}, but none of them is ${gn(o.filters)}`}. Try "which ${i} ${$i(o.kind)} ${o.object}" for that branch on its own.`,miss:!0,ambiguous:!1,matches:[]}}let r=s||Xs(n);return{content:`nothing in the index matches that${t.entityType?` (${Te(t.entityType,2)})`:""}. ${r}`,miss:!0,ambiguous:!1,matches:[]}}return{content:`${js(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}}function md(){return`"which <functions|classes|modules> <imports|calls|uses|inherits from|tests> <name>" or "what does <name> <import|call|export>" or "what uses <name>" or "where is <name> defined" / "where is <name> mentioned" or "when did <name> change" or "which commits touched <name>" or "which changes touch commit <sha>"/"what did commit <sha> touch" (a commit's own changes) or plainly "what calls this" (about a selected node) or "what does <term> mean"/"what is a <ClassName>" (about the graph's own vocabulary). `+Zu()}function Xs(e=null){return e&&ri(e)===0?ku:`Try "who touched <a module that actually has commits>" or "/describe <module>" to see what's in the index.`}function _o(e){return new Set(String(e).toLowerCase().split(/[^a-z0-9]+/).filter(Boolean))}function Za(e){if(e.length<5)return e;let t=e.replace(/(ing|ers|ors|er|or)$/,"");return t===e?e:t.length>=3&&t[t.length-1]===t[t.length-2]?t.slice(0,-1):t}function Wb(e){return String(e||"").replace(/\.[a-z0-9]+$/i,"").toLowerCase().replace(/[/\-_.]+/g,"")}function IT(e){return String(e||"").trim().replace(/^(?:the|a|an)\s+/i,"").toLowerCase().replace(/[\s\-_]+/g,"")}function gi(e,t,{expectedClass:n=null}={}){let s=String(t||"").trim();if(!s)return{match:null,candidates:[],tier:null,ambiguous:!1};let o=s.toLowerCase(),r=n?e.individuals.filter(g=>g.class===n):e.individuals,i=o.match(/^(commit[:\s])?([0-9a-f]{7,40})$/);if(i){let g=i[2],b=r.filter(y=>y.class==="Commit"&&(String(y.id).toLowerCase().startsWith(`commit:${g}`)||String(y.label).toLowerCase().startsWith(g)));if(b.length===1)return{match:b[0],candidates:[],tier:1,ambiguous:!1};if(b.length>1)return{match:b[0],candidates:b.slice(1,5),tier:1,ambiguous:!0};if(i[1])return{match:null,candidates:[],tier:null,ambiguous:!1}}let a=r.find(g=>String(g.label).toLowerCase()===o||String(g.id).toLowerCase()===o);if(a)return{match:a,candidates:[],tier:1,ambiguous:!1};let c=`ext:${o}`,l=null;e:for(let g of e.relations)for(let b of g.edges)if(String(b.object).toLowerCase()===c){l=b.object;break e}if(l&&!n)return{match:{id:l,label:s,class:null},candidates:[],tier:2,ambiguous:!1};let u=s.split(/\s+and\s+/i).map(g=>g.trim()).filter(Boolean);if(u.length>1){let g=new Set;for(let b of u){let y=gi(e,b,{expectedClass:n});y.match&&!y.ambiguous&&g.add(y.match.id)}if(g.size>1)return{match:null,candidates:[],tier:null,ambiguous:!1}}let d=[],p=!o.includes("/")&&/^[\w$]+(\.[\w$]+)+$/.test(o);if(p){let g=o.split(".").pop();for(let b of r){let y=String(b.label||"").toLowerCase();b.class==="Module"?y.split("/").pop()===o&&d.push({ind:b,score:1e3-Math.abs(y.length-o.length)}):y.includes(o)?d.push({ind:b,score:2e3-Math.abs(y.length-o.length)}):y.endsWith(`.${g}`)&&d.push({ind:b,score:1500-Math.abs(y.length-o.length)})}}else{let g=[..._o(s)],b=o.split(/\s+/).find(v=>v.includes("/")),y=b?b.split("/").pop().replace(/\.[a-z0-9]+$/,""):null,E=s.trim().replace(/^(?:the|a|an)\s+/i,"").trim().split(/\s+/).filter(Boolean).length>=2,_=E?IT(s):null;for(let v of r){let S=String(v.label||"").toLowerCase(),C=S.split("/").pop().replace(/\.[a-z0-9]+$/,"");if(C===o){d.push({ind:v,score:5e3});continue}if(o.length>=4&&(C.startsWith(o)||C.endsWith(o))){d.push({ind:v,score:4e3-Math.abs(C.length-o.length)});continue}if(E){let w=Wb(v.label);if(w&&w===_){d.push({ind:v,score:5e3});continue}let T=/[/_-]/.test(v.label)||/\.[a-z0-9]+$/i.test(String(v.label||""));if(w&&T&&_.length>=4&&w.includes(_)){d.push({ind:v,score:2e3-Math.abs(w.length-_.length)});continue}}if(v.class==="Module"){let w=Za(o);if(w!==o&&w===Za(C)){let T=Ss(o);if(Es(C,o,T)>T){d.push({ind:v,score:3e3-Math.abs(C.length-o.length)});continue}}}if(o.length>=4&&S.includes(o)){d.push({ind:v,score:1e3-Math.abs(S.length-o.length)});continue}let x=_o(v.label),R=g.filter(w=>x.has(w)).length;R>0&&(!y||x.has(y))&&d.push({ind:v,score:R/g.length*Gu})}}if(d.sort((g,b)=>b.score-g.score),d.length){let[g,...b]=d,y=b.filter(E=>E.score===g.score),$=g.score>=Gu?b.filter(E=>E.score>=Gu):b;return{match:g.ind,candidates:$.slice(0,4).map(E=>E.ind),tier:3,ambiguous:y.length>0}}let f=p||o.includes("/"),m=null,h=!f&&typeof xo=="function"?xo(e.proseIndex,s).filter(g=>!n||e.byId.get(g.id)?.class===n):[];if(h.length){let[g,...b]=h,y=e.byId.get(g.id);if(y){let $=b.filter(E=>E.score===g.score);if(m={match:y,candidates:b.slice(0,4).map(E=>e.byId.get(E.id)).filter(Boolean),tier:4,ambiguous:$.length>0,matchedVia:"prose"},!m.ambiguous&&g.via!=="spell")return m}}if(!i&&o.length>=4){let g=Ss(o),b=g+1,y=[];for(let $ of r){let E=Es(String($.label||"").toLowerCase(),o,g);if(E>0)for(let _ of _o($.label)){if(E<=0)break;E=Math.min(E,Es(_,o,g))}E<b?(b=E,y=[$]):E===b&&E<=g&&y.push($)}if(b<=g&&y.length===1)return{match:y[0],candidates:[],tier:5,ambiguous:!1,matchedVia:"fuzzy"};if(b<=g&&y.length>1&&!m){let[$,...E]=y;return{match:$,candidates:E.slice(0,4),tier:5,ambiguous:!0,matchedVia:"fuzzy"}}}return m||{match:null,candidates:[],tier:null,ambiguous:!1}}function Vu(e,t){let n=Wb(t),s=[..._o(t)],o=[];for(let r of _o(e))n.includes(r)||s.some(i=>Za(i)===Za(r))||Ja.has(r)||qb.has(r)||o.push(r);return o}function Ka(e,t){if(!e?.match||e.tier!==3||e.matchedVia)return e;if(e.ambiguous){let s=[e.match,...e.candidates||[]],o=s.map(r=>new Set(Vu(t,r.label))).reduce((r,i)=>r.filter(a=>i.has(a)),Vu(t,s[0].label));return o.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:o,nearestLabel:gn(s.slice(0,4).map(r=>r.label))}:e}let n=Vu(t,e.match.label);return n.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:n,nearestLabel:e.match.label}:e}function wn(e,t,n={}){let{expectedClass:s=null}=n;if(!s){let o=String(t||"").trim(),r=o.replace(OT,"").trim(),i=r.match(NT);if(i){let a=r.slice(0,i.index).trim(),c=Ze[i[1].toLowerCase()];if(a&&c){let l=Ka(gi(e,a,{expectedClass:c}),a);if(l?.match?.id&&!l.ambiguous)return l}}if(r&&r!==o){let a=Ka(gi(e,r,n),r);if(a?.match?.id&&!a.ambiguous)return a}return Ka(gi(e,t,n),t)}return Ka(gi(e,t,n),t)}function Rs(e,t,n){if(wo.includes(String(t||"").trim().toLowerCase())){if(!n)return{match:null,candidates:[],tier:null,ambiguous:!1,unresolvedPronoun:!0};let s=e.byId.get(n);return s?{match:s,candidates:[],tier:1,ambiguous:!1}:{match:null,candidates:[],tier:null,ambiguous:!1,unresolvedPronoun:!0}}return wn(e,t)}function hd(e,t,n){let s=[];for(let o of Qe(e,"defines")){if(!t.has(o.subject))continue;let r=e.byId.get(o.object);r&&r.class===n&&s.push(r)}return s}function Gb(e,t,n,s={}){let o=!n||n==="Change"||n==="Commit",r=o||n==="Module",i=o||Js.has(n),a=[...r?["touches"]:[],...i?["touchesSymbol"]:[]],c=a.flatMap(l=>Qe(e,l)).filter(l=>l.subject===t.id).map(l=>e.byId.get(l.object)).filter(Boolean);return n&&Js.has(n)&&(c=c.filter(l=>l.class===n)),{matches:c,objMatch:t,commitSubject:!0,ambiguous:!1,candidates:[],traversal:`${a.join("+")} edges where subject = commit ${t.label}`,...s}}function FT(e,t){let n=new Set(String(t||"").toLowerCase().split(/[\s-]+/).filter(Boolean));return(e.individuals||[]).filter(s=>s.class==="Module"&&gd.has(fb(s.label))).map(s=>({ind:s,named:n.has(fb(s.label))?1:0,depth:String(s.label).split("/").length,fixture:MT(s.label)?1:0})).sort((s,o)=>o.named-s.named||s.depth-o.depth||s.fixture-o.fixture||String(s.ind.label).localeCompare(String(o.ind.label))).map(s=>s.ind)}function DT(e,t,n){return e!=="reverse"?!1:t==="imports"||t==="calls"?!n||n==="Module":t==="inherits"?!n||n==="Class":!1}function zT(e,t,n){let s=At(n).flatMap(a=>Qe(e,a)),o=a=>{let c=`ext:${String(a.label).toLowerCase()}`;return s.filter(l=>l.object===a.id||String(l.object).toLowerCase()===c).map(l=>e.byId.get(l.subject)).filter(Boolean)},r=new Map,i=o(t);for(;i.length;){let a=i.shift();r.has(a.id)||a.id===t.id||(r.set(a.id,a),i.push(...o(a)))}return[...r.values()].sort((a,c)=>String(a.label).localeCompare(String(c.label)))}function bd(e){return(e?.attributes||[]).find(t=>UT.has(t.prop))?.value||null}function BT(e){return e==="SchemaClass"?"a class in the graph's schema":e==="SchemaPredicate"?"a predicate (relation) in the graph's schema":`${ko(e)} ${e} in this graph's vocabulary`}function on(e,t,{contextId:n=null,prev:s=null,pinnedObjMatch:o=null}={}){if(!t)return{matches:[],objMatch:null,candidates:[],traversal:null,ambiguous:!1};if(t.node)return RT(e,t,{contextId:n,prev:s});if(t.ambiguousParse){let j=t.candidates.map(k=>{let P=on(e,k,{contextId:n,prev:s});return{parsed:k,result:P,rendered:zn(k,P,e)}});return{matches:[],objMatch:null,candidates:t.candidates,traversal:null,ambiguous:!0,branches:j}}let{shape:r,kind:i,entityType:a}=t;if(r==="meta"){let j=String(t.object||"").trim(),k=j.toLowerCase(),P=(e.individuals||[]).find(U=>{if(!bd(U))return!1;if(String(U.label).toLowerCase()===k)return!0;let H=(U.attributes||[]).find(X=>X.key==="token")?.value;return H&&String(H).toLowerCase()===k});if(!P){let U=Nb(e,j);return U?{matches:[U.hit],objMatch:U.hit,candidates:[],ambiguous:!1,metaCodeClass:!0,metaFallbackText:U.text,traversal:`schema lookup for "${j}" (miss), then unique code-entity individual by label`}:{matches:[],objMatch:null,candidates:[],traversal:`schema lookup for "${j}"`,ambiguous:!1}}return{matches:[P],objMatch:P,candidates:[],traversal:`schema lookup for "${j}"`,ambiguous:!1}}if(r==="mentions"){let j=String(t.object||"").trim();return{matches:(typeof xo=="function"?xo(e.proseIndex,j):[]).map(U=>e.byId.get(U.id)).filter(Boolean),objMatch:null,candidates:[],ambiguous:!1,mentionsShape:!0,traversal:`proseIndex word lookup for "${j}"`}}if(r==="where"&&LT.test(String(t.object||"").trim())){let j=FT(e,t.object);return{matches:j,objMatch:j[0]||null,candidates:j.slice(1,5),ambiguous:!1,entryPointShape:!0,traversal:`Module individuals with an entry-point basename (${[...gd].join("/")}), ranked query-named basename first, then shallower path, then non-test path`}}if(t.modifier&&t.modifier!=="direct"&&!DT(r,i,a))return{matches:[],objMatch:null,candidates:[],ambiguous:!1,unsupportedModifier:!0,traversal:`modifier "${t.modifier}" requested for a "${i}" query \u2014 no closure traversal exists for this combination yet`};if(r==="ask"){let j=Rs(e,t.subject,n),k=Rs(e,t.object,n);if(!j.match||!k.match||j.ambiguous||k.ambiguous)return{matches:[],objMatch:k.match,candidates:k.candidates,traversal:null,ambiguous:!1,answer:null,unresolvedPronoun:!!(j.unresolvedPronoun||k.unresolvedPronoun)};let[P,U]=[j.match,k.match];i==="touches"&&U.class==="Commit"&&P.class!=="Commit"&&([P,U]=[U,P]);let H=wr[i],X=[...new Set(H?[...At(i),H]:At(i))],Q=X.flatMap(L=>Qe(e,L)).filter(L=>L.subject===P.id&&L.object===U.id);return{matches:Q,answer:t.negated?Q.length===0:Q.length>0,objMatch:k.match,subjMatch:j.match,candidates:[],traversal:`${X.join("+")} edge from ${P.label} to ${U.label}`,ambiguous:!1}}let c;if(o)c={match:o,candidates:[],ambiguous:!1,matchedVia:null};else{if(c=Rs(e,t.object,n),t.altObject&&t.altObject!==t.object){let j=Rs(e,t.altObject,n),k=!!c.match&&!c.ambiguous,P=!!j.match&&!j.ambiguous;!k&&P?c=j:k&&P&&c.match.id!==j.match.id&&(c={...c,ambiguous:!0,candidates:[j.match,...c.candidates||[]]})}if(t.kind==="tests"&&c.match&&!c.ambiguous&&!String(t.object||"").includes("/")){let j=U=>U.replace(/\.(?:test|spec|tests)(?=\.[^.]+$)/,""),k=j(String(t.object||"").trim().toLowerCase()),P=(e.individuals||[]).find(U=>{if(U.class!=="Module"||U.id===c.match.id)return!1;let H=String(U.label||"").toLowerCase().split("/").pop();return H!==j(H)&&j(H)===k});P&&(c={...c,ambiguous:!0,candidates:[P,...c.candidates||[]]})}}let{match:l,candidates:u,ambiguous:d,unresolvedPronoun:p,matchedVia:f,unplacedWords:m,nearestLabel:h}=c;if(!l)return{matches:[],objMatch:null,candidates:u,traversal:null,ambiguous:!1,unresolvedPronoun:p,unplacedWords:m,nearestLabel:h};if(d){let k=bn([l,...u||[]]).slice(0,rt).map(P=>{let U=on(e,t,{contextId:n,prev:s,pinnedObjMatch:P});return{candidate:P,result:U,rendered:zn(t,U,e)}});return{matches:[],objMatch:l,candidates:u,traversal:null,ambiguous:!0,branches:k}}if(r==="where"){let j=(l.attributes||[]).find(k=>k.key==="site")?.value||null;return{matches:[l],objMatch:l,candidates:u,ambiguous:d,matchedVia:f,whereShape:!0,site:j,traversal:j?`site attribute of ${l.label}`:`class + defining module of ${l.label}`}}if(r==="when"){let j=U=>String((U.attributes||[]).find(H=>H.key==="date")?.value||""),k;if(l.class==="Commit")k=[l];else{let U=["touches","touchesSymbol"].flatMap(X=>Qe(e,X)).filter(X=>X.object===l.id),H=new Set;k=[];for(let X of U){if(H.has(X.subject))continue;H.add(X.subject);let Q=e.byId.get(X.subject);Q&&Q.class==="Commit"&&k.push(Q)}k.sort((X,Q)=>j(Q).localeCompare(j(X)))}let P=k.length&&j(k[0])?[{kind:"event",class:"Commit",label:k[0].label,ids:[k[0].id],attrs:{date:j(k[0]).slice(0,10)},lane:"when"}]:[];return{matches:k,objMatch:l,candidates:u,ambiguous:d,matchedVia:f,whenShape:!0,referents:P,traversal:`touches+touchesSymbol edges where object = ${l.label}, newest commit date first`}}if(r==="whoLast"){let j=X=>String((X.attributes||[]).find(Q=>Q.key==="date")?.value||""),k=["touches","touchesSymbol"].flatMap(X=>Qe(e,X)).filter(X=>X.object===l.id),P=new Set,U=[];for(let X of k){if(P.has(X.subject))continue;P.add(X.subject);let Q=e.byId.get(X.subject);Q&&Q.class==="Commit"&&U.push(Q)}U.sort((X,Q)=>j(Q).localeCompare(j(X)));let H=U.length&&j(U[0])?[{kind:"event",class:"Commit",label:U[0].label,ids:[U[0].id],attrs:{date:j(U[0]).slice(0,10)},lane:"whoLast"}]:[];return{matches:U,objMatch:l,candidates:u,ambiguous:d,matchedVia:f,whoLastShape:!0,referents:H,traversal:`touches+touchesSymbol edges where object = ${l.label}, newest commit's author`}}if(i==="touches"&&l.class==="Commit")return Gb(e,l,a,{candidates:u,ambiguous:d,matchedVia:f});if(r==="forward"){let j=wr[i],P=!!(j&&l.class&&Js.has(l.class))?[...new Set([...At(i),j])]:At(i);if(a&&a!=="Change"){let V=id(e,P),W=Wu[a];if(V.size&&!V.has(a)&&!(W&&V.has(W)))return{matches:[],objMatch:l,candidates:u,ambiguous:d,matchedVia:f,forwardGrainMiss:!0,wantClasses:[...V],traversal:`${P.join("+")} edges where subject = ${l.label} (grain mismatch: this "${i}" relation never targets a ${ks(a)})`}}let H=P.flatMap(V=>Qe(e,V)).filter(V=>V.subject===l.id).map(V=>e.byId.get(V.object)).filter(Boolean),X=bn(H),Q=X,L="";if(a&&a!=="Change"){Q=X.filter(W=>W.class===a);let V=Wu[a];if(!Q.length&&V){let W=X.filter(O=>O.class===V);W.length&&(Q=W,L=`, widened to ${V} subjects (no ${a} recorded)`)}}return{matches:Q,objMatch:l,candidates:u,traversal:`${P.join("+")} edges where subject = ${l.label}${L}`,ambiguous:d,matchedVia:f}}if(t.modifier==="transitive")return i==="inherits"?{matches:zT(e,l,i),objMatch:l,candidates:u,ambiguous:d,matchedVia:f,traversal:`subclass closure over inherits edges from ${l.label}`}:{matches:dr(e,l,{maxDepth:pb,includeCycleReturn:!0}).flat().map(P=>e.byId.get(P.id)).filter(Boolean),objMatch:l,candidates:u,ambiguous:d,matchedVia:f,traversal:`reverse dependency closure over imports+calls edges from ${l.label} (impactClosure, maxDepth=${pb})`};let g=wr[i]||At(i).find(j=>bb.has(j))||null,b=!!(l.class&&Js.has(l.class));if(g&&(Js.has(a)||b)){let j=Qe(e,g).filter(L=>L.object===l.id),k=bn(j.map(L=>e.byId.get(L.subject)).filter(Boolean)),P=!a||a==="Change"?k:k.filter(L=>L.class===a),U="",H=Wu[a];if(!P.length&&H){let L=k.filter(V=>V.class===H);L.length&&(P=L,U=`, widened to ${H} subjects (no ${a} recorded)`)}let X=(i==="touches"||i==="calls"||i==="uses")&&l.class==="Class"&&!Qe(e,"contains").some(L=>L.subject===l.id),Q=X?e.byId.get(Ao(e,l)||""):null;if(P.length||!(X&&Q))return{matches:P,objMatch:l,candidates:u,traversal:`${g} edges where object = ${l.label}${U}`,ambiguous:d,matchedVia:f}}let y=l,$=u,E=d,_=f,v="",S=xb(e,i);if(S&&y.class&&y.class!==S){let j=wn(e,t.object,{expectedClass:S});if(j.match&&!j.ambiguous)y=j.match,$=j.candidates,E=j.ambiguous,_=j.matchedVia;else if(S==="Module"){let k=Ao(e,y),P=k&&e.byId.get(k);if(P)v=`, refined from ${y.label} to its containing module`,y=P;else return{matches:[],objMatch:y,candidates:$,ambiguous:E,matchedVia:_,wrongGrainMiss:!0,wantClass:S,traversal:`"${t.object}" resolved to ${ks(y.class)} ${y.label} (grain mismatch: this "${i}" question needs a ${ks(S)}, and no containing module could be found to refine to)`}}else return{matches:[],objMatch:y,candidates:$,ambiguous:E,matchedVia:_,wrongGrainMiss:!0,wantClass:S,traversal:`"${t.object}" resolved to ${ks(y.class)} ${y.label} (grain mismatch: this "${i}" question needs a ${ks(S)})`}}let C=At(i).flatMap(j=>Qe(e,j)).filter(j=>j.object===y.id);i==="cochange"&&(C=C.concat(At(i).flatMap(j=>Qe(e,j)).filter(j=>j.subject===y.id).map(j=>({...j,subject:j.object,object:j.subject}))));let x="";if(!C.length&&y.class){let j=`ext:${String(y.label).toLowerCase()}`;C=At(i).flatMap(k=>Qe(e,k)).filter(k=>String(k.object).toLowerCase()===j),C.length&&(x=` (by name, via unresolved ${j} references)`)}let R=[],w=new Set;for(let j of C){let k=e.byId.get(j.subject);k&&!w.has(k.id)&&(w.add(k.id),R.push(k))}let T,I="";if(!a||a==="Change")T=R;else{let j=R.filter(P=>P.class===a),k=j.length||!Ob(i,a)?[]:Ib(e,new Set([y.id]));if(j.length)T=j;else if(k.length)T=k,I=`, falling back to ${y.label}'s recorded source site (no defines edge)`;else if(a!=="Module"&&R.some(P=>P.class==="Module")){let P=new Set(R.filter(U=>U.class==="Module").map(U=>U.id));T=hd(e,P,a),I=`, then ${ks(a)} defined in the matched module(s)`}else T=[]}return{matches:T,objMatch:y,candidates:$,traversal:`${At(i).join("+")} edges where object = ${y.label}${x}${I}${v}`,ambiguous:E,matchedVia:_}}function Co(e){if(e.class==="Module")return e.label;let t=(e.attributes||[]).find(s=>s.key==="site")?.value;if(t)return String(t).split(":")[0];let n=String(e.id||"").match(/^fn:(.+)#/);return n?n[1]:null}function td(e,t){let n=String(t||"").match(/^(.*):(\d+)(?:-(\d+))?$/);if(n){let o=n[3]&&n[3]!==n[2]?`lines ${n[2]}-${n[3]}`:`line ${n[2]}`;return`${nd(e)} is defined in ${n[1]} at ${o}.`}let s=Co(e);return s?`${nd(e)} is defined in ${s} (no line span recorded in this index).`:null}function nd(e){let t=String(e.label||e.id||"");return["Function","Method"].includes(e.class)?`function ${t}()`:t}function WT(e){let t=String(e.label||e.id||""),n=(e.attributes||[]).find(s=>s.key==="author")?.value;return n?`${t} (${n})`:t}function gn(e){return e.length>1?`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`:e[0]}function bi(e){let t=e.object??e.subject??"?";return`${e.entityType?Te(e.entityType,2)+" that ":""}${e.kind} "${t}"`}function $i(e){return Jr[e]?.bare||e}function GT(e){let t=$i(e);return t.endsWith("e")?`${t}d`:`${t}ed`}function VT(e){if(!Array.isArray(e.atoms)||e.atoms.length!==2)return null;let[t,n]=e.atoms;if(t.op!=="seed"||t.ast?.node!=="allOfClass"||n.op!=="difference")return null;let s=Te(e.entityType,2);if(n.kind==="qual")return`${s} that are not ${n.filters.join(" and not ")}`;if(n.kind!=="set"||!n.ast)return null;if(n.ast.node==="existsEdge")return`${s} that do not ${$i(n.ast.kind)} anything`;let o=n.ast.node==="clause"?n.ast.clause:n.ast;if(!o||o.node||!o.kind)return null;let r=o.object??o.subject;return r==null?null:`${s} that do not ${$i(o.kind)} ${JSON.stringify(String(r))}`}function Vb(e){if(!e)return null;if(e.ambiguousParse)return{english:`ambiguous: ${e.candidates.map(bi).join(" \u2014 or \u2014 ")}`,machine:`ambiguousParse(${e.candidates.map(r=>Vb(r)?.machine).join(", ")})`};if(e.node)return{english:(e.node==="boolean"?VT(e):null)||`a compositional query (${e.node})`,machine:`composite(${e.node})`};let t=r=>JSON.stringify(String(r??"")),n=[];e.kind&&n.push(e.kind),e.negated&&n.push("negated"),e.entityType&&n.push(`entityType=${e.entityType}`),e.modifier&&e.modifier!=="direct"&&n.push(`modifier=${e.modifier}`),e.subject!=null&&n.push(`subject=${t(e.subject)}`),e.object!=null&&n.push(t(e.object));let s=`${e.shape}(${n.join(", ")})`,o;if(e.shape==="ask")o=`does "${e.subject}" ${e.negated?"not ":""}${Qs(e.kind)} "${e.object}"?`;else if(e.shape==="meta")o=`what does "${e.object}" mean, in this graph's own vocabulary?`;else if(e.shape==="mentions")o=`where is "${e.object}" mentioned?`;else if(e.shape==="where")o=`where is "${e.object}" defined?`;else{let r=e.entityType?Te(e.entityType,2)+" that ":"";o=e.shape==="forward"?`what "${e.object}" itself ${Qs(e.kind)}`:`${r}${Qs(e.kind)} "${e.object}"`}return{english:o,machine:s}}function zn(e,t,n=null){let s=Hb(e,t,n);return t&&t.matchedVia==="fuzzy"&&t.objMatch&&!s.ambiguous&&(s.content=`assuming you meant ${t.objMatch.label}: ${s.content}`),s}function Hb(e,t,n){if(!e)return{content:`couldn't parse this as a graph question. Try: ${md()}`,miss:!0,ambiguous:!1};if(e.node)return CT(e,t,n);if(e.ambiguousParse)return t.branches&&t.branches.length?{content:`this could mean more than one thing:
55
+ ${t.branches.map((c,l)=>`${l+1}) as ${bi(c.parsed)}: ${c.rendered.content}`).join(`
56
56
  `)}
57
- (ask one of these directly, or try rephrasing more specifically, to get just that reading)`,miss:!1,ambiguous:!0,candidates:e.candidates.map(hi),candidateParses:e.candidates}:{content:`this could mean more than one thing: ${e.candidates.map((a,c)=>`${c+1}) ${hi(a)}`).join(" or ")} \u2014 try rephrasing more specifically.`,miss:!1,ambiguous:!0,candidates:e.candidates.map(hi),candidateParses:e.candidates};if(t.unresolvedPronoun)return{content:`"${e.object??e.subject}" needs a selected node to refer to \u2014 click a node first, or name it directly.`,miss:!0,ambiguous:!1};if(t.unsupportedModifier)return{content:`the "${e.modifier}" modifier isn't supported for "${e.kind}" queries yet \u2014 only imports/calls (module-level) have a transitive closure today.`,miss:!0,ambiguous:!1};if(t.wrongGrainMiss){let i=t.objMatch.class?Ne(t.objMatch.class,1):"term",a=Ne(t.wantClass,1);return{content:`"${e.object}" resolved to the ${i} ${t.objMatch.label}, but this question needs a ${a} \u2014 no ${a} named "${e.object}" was found in the index.`,miss:!0,ambiguous:!1}}if(t.forwardGrainMiss){let i=t.wantClasses.map(a=>Ne(a,2));return{content:`${t.objMatch.label}'s "${ko(e.kind)}" relation in this index never produces ${Ne(e.entityType,2)} \u2014 only ${Fn(i)}.`,miss:!0,ambiguous:!1}}if(e.shape==="meta"){if(!t.objMatch)return{content:`"${e.object}" isn't a term in this graph's own vocabulary (no matching class or predicate).`,miss:!0,ambiguous:!1};if(t.metaCodeClass)return{content:t.metaFallbackText,miss:!1,ambiguous:!1,matches:t.matches};let i=md(t.objMatch)||"";return{content:`${t.objMatch.label} is ${LT(t.objMatch.class)}: ${i}`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.mentionsShape){if(!t.matches.length)return{content:`"${e.object}" is not mentioned in any indexed identifier or doc-comment prose.`,miss:!0,ambiguous:!1};let i=t.matches.slice(0,rt).map(c=>`${c.label} (${Ne(c.class,1)})`),a=t.matches.length>rt?`, \u2026and ${t.matches.length-rt} more`:"";return{content:`"${e.object}" is mentioned in the prose tokens of ${Fn(i)}${a}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.entryPointShape){if(!t.matches.length)return{content:`no entry-point module found in the index \u2014 no module basename matches ${Fn([...pd])}.`,miss:!0,ambiguous:!1,candidates:[]};let[i,...a]=t.matches,c=a.slice(0,rt).map(d=>d.label),l=a.length>rt?`, \u2026and ${a.length-rt} more`:"",u=a.length?` \u2014 also matched: ${Fn(c)}${l}`:"";return{content:`ranked ${t.matches.length} entry-point match${t.matches.length===1?"":"es"}; top: ${i.label}${u}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(!t.objMatch&&(!t.candidates||t.candidates.length===0)&&e.shape!=="ask"){let i=String(e.object||"").trim(),a=e.entityType&&Wu[e.entityType]?Ne(e.entityType,1):"module",c=/^(?:commit[:\s])?[0-9a-f]{7,40}$/i.test(i)?"commit":!i.includes("/")&&/^[\w$]+(\.[\w$]+)+$/.test(i)?"symbol":a;if(t.unplacedWords?.length){let l=Fn(t.unplacedWords.map(p=>`"${p}"`)),u=t.unplacedWords.length===1?"names":"name",d=t.nearestLabel?` Did you mean ${t.nearestLabel}?`:"";return{content:`no ${c} matching "${e.object}" found in the index. ${l} ${u} nothing here, and reading past ${t.unplacedWords.length===1?"it":"them"} would answer a different question.${d}`,miss:!0,ambiguous:!1,candidates:[]}}return{content:`no ${c} matching "${e.object}" found in the index. ${Xs(n)}`,miss:!0,ambiguous:!1,candidates:[]}}if(t.ambiguous){let i=[t.objMatch,...t.candidates||[]].filter(Boolean),a=t.branches;if(e.kind&&e.kind!=="touches"&&!i.every(b=>b.class==="Commit")){let b=$=>!["Commit","Session","Source","Utterance"].includes($?.class),y=i.filter(b);y.length&&(i=y,a?.length&&(a=a.filter($=>b($.candidate))))}if(n&&!/[/.]/.test(String(e.object||""))){let b=String(e.object||"").toLowerCase(),y=new Set(Yn(String(e.object||"")).filter(S=>S.length>=3)),$=new Set(i.map(S=>S.id)),E=null,_=0,v=1/0;if(y.size)for(let S of n.individuals){if(!["Function","Method","Class","GlobalVariable","Attribute"].includes(S.class)||$.has(S.id))continue;let C=Yn(String(S.label)).filter(R=>y.has(R)).length;if(!C||C<_)continue;let x=Es(String(S.label).toLowerCase(),b,8);(C>_||x<v)&&(E=S,_=C,v=x)}if(E&&(i=[...i,E],a)){let S=sn(n,e,{pinnedObjMatch:E});a=[...a,{candidate:E,result:S,rendered:Dn(e,S,n)}]}}let c=i.length&&i.every(b=>b.class===i[0].class)?i[0].class:null,l=c?Wu[c]?Ne(c,1):ks(c):"module",u=i.slice(0,rt).map(b=>b.label),d=i.length>rt?`, \u2026and ${i.length-rt} more`:"",p=`"${e.object}" matches more than one ${l} ambiguously \u2014 did you mean ${Fn(u)}${d}? Try one of those. If you're not sure, narrow it to one name.`,f=String(e.object||""),m=f?new RegExp(`\\b${ot(f)}\\b`,"gi"):null,h=b=>{let y=String(b.candidate.label||"");return!m||!y?b.rendered.content:b.rendered.content.split(y).map($=>$.replace(m,y)).join(y)};return{content:a&&a.length?`${p}
57
+ (ask one of these directly, or try rephrasing more specifically, to get just that reading)`,miss:!1,ambiguous:!0,candidates:e.candidates.map(bi),candidateParses:e.candidates}:{content:`this could mean more than one thing: ${e.candidates.map((a,c)=>`${c+1}) ${bi(a)}`).join(" or ")} \u2014 try rephrasing more specifically.`,miss:!1,ambiguous:!0,candidates:e.candidates.map(bi),candidateParses:e.candidates};if(t.unresolvedPronoun)return{content:`"${e.object??e.subject}" needs a selected node to refer to \u2014 click a node first, or name it directly.`,miss:!0,ambiguous:!1};if(t.unsupportedModifier)return{content:`the "${e.modifier}" modifier isn't supported for "${e.kind}" queries yet \u2014 only imports/calls (module-level) have a transitive closure today.`,miss:!0,ambiguous:!1};if(t.wrongGrainMiss){let i=t.objMatch.class?Te(t.objMatch.class,1):"term",a=Te(t.wantClass,1);return{content:`"${e.object}" resolved to the ${i} ${t.objMatch.label}, but this question needs a ${a} \u2014 no ${a} named "${e.object}" was found in the index.`,miss:!0,ambiguous:!1}}if(t.forwardGrainMiss){let i=t.wantClasses.map(a=>Te(a,2));return{content:`${t.objMatch.label}'s "${Qs(e.kind)}" relation in this index never produces ${Te(e.entityType,2)} \u2014 only ${gn(i)}.`,miss:!0,ambiguous:!1}}if(e.shape==="meta"){if(!t.objMatch)return{content:`"${e.object}" isn't a term in this graph's own vocabulary (no matching class or predicate).`,miss:!0,ambiguous:!1};if(t.metaCodeClass)return{content:t.metaFallbackText,miss:!1,ambiguous:!1,matches:t.matches};let i=bd(t.objMatch)||"";return{content:`${t.objMatch.label} is ${BT(t.objMatch.class)}: ${i}`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.mentionsShape){if(!t.matches.length)return{content:`"${e.object}" is not mentioned in any indexed identifier or doc-comment prose.`,miss:!0,ambiguous:!1};let i=t.matches.slice(0,rt).map(c=>`${c.label} (${Te(c.class,1)})`),a=t.matches.length>rt?`, \u2026and ${t.matches.length-rt} more`:"";return{content:`"${e.object}" is mentioned in the prose tokens of ${gn(i)}${a}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.entryPointShape){if(!t.matches.length)return{content:`no entry-point module found in the index \u2014 no module basename matches ${gn([...gd])}.`,miss:!0,ambiguous:!1,candidates:[]};let[i,...a]=t.matches,c=a.slice(0,rt).map(d=>d.label),l=a.length>rt?`, \u2026and ${a.length-rt} more`:"",u=a.length?` \u2014 also matched: ${gn(c)}${l}`:"";return{content:`ranked ${t.matches.length} entry-point match${t.matches.length===1?"":"es"}; top: ${i.label}${u}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(!t.objMatch&&(!t.candidates||t.candidates.length===0)&&e.shape!=="ask"){let i=String(e.object||"").trim(),a=e.entityType&&qu[e.entityType]?Te(e.entityType,1):"module",c=/^(?:commit[:\s])?[0-9a-f]{7,40}$/i.test(i)?"commit":!i.includes("/")&&/^[\w$]+(\.[\w$]+)+$/.test(i)?"symbol":a;if(t.unplacedWords?.length){let l=gn(t.unplacedWords.map(p=>`"${p}"`)),u=t.unplacedWords.length===1?"names":"name",d=t.nearestLabel?` Did you mean ${t.nearestLabel}?`:"";return{content:`no ${c} matching "${e.object}" found in the index. ${l} ${u} nothing here, and reading past ${t.unplacedWords.length===1?"it":"them"} would answer a different question.${d}`,miss:!0,ambiguous:!1,candidates:[]}}return{content:`no ${c} matching "${e.object}" found in the index. ${Xs(n)}`,miss:!0,ambiguous:!1,candidates:[]}}if(t.ambiguous){let i=[t.objMatch,...t.candidates||[]].filter(Boolean),a=t.branches;if(e.kind&&e.kind!=="touches"&&!i.every(b=>b.class==="Commit")){let b=$=>!["Commit","Session","Source","Utterance"].includes($?.class),y=i.filter(b);y.length&&(i=y,a?.length&&(a=a.filter($=>b($.candidate))))}if(n&&!/[/.]/.test(String(e.object||""))){let b=String(e.object||"").toLowerCase(),y=new Set(Yn(String(e.object||"")).filter(S=>S.length>=3)),$=new Set(i.map(S=>S.id)),E=null,_=0,v=1/0;if(y.size)for(let S of n.individuals){if(!["Function","Method","Class","GlobalVariable","Attribute"].includes(S.class)||$.has(S.id))continue;let C=Yn(String(S.label)).filter(R=>y.has(R)).length;if(!C||C<_)continue;let x=Es(String(S.label).toLowerCase(),b,8);(C>_||x<v)&&(E=S,_=C,v=x)}if(E&&(i=[...i,E],a)){let S=on(n,e,{pinnedObjMatch:E});a=[...a,{candidate:E,result:S,rendered:zn(e,S,n)}]}}let c=i.length&&i.every(b=>b.class===i[0].class)?i[0].class:null,l=c?qu[c]?Te(c,1):ks(c):"module",u=i.slice(0,rt).map(b=>b.label),d=i.length>rt?`, \u2026and ${i.length-rt} more`:"",p=`"${e.object}" matches more than one ${l} ambiguously \u2014 did you mean ${gn(u)}${d}? Try one of those. If you're not sure, narrow it to one name.`,f=String(e.object||""),m=f?new RegExp(`\\b${ot(f)}\\b`,"gi"):null,h=b=>{let y=String(b.candidate.label||"");return!m||!y?b.rendered.content:b.rendered.content.split(y).map($=>$.replace(m,y)).join(y)};return{content:a&&a.length?`${p}
58
58
  ${a.map((b,y)=>`${y+1}) ${b.candidate.label}: ${h(b)}`).join(`
59
- `)}`:p,miss:!1,ambiguous:!0,candidates:i.map(b=>b.label)}}if(t.whereShape){let i=t.objMatch;if(i.class==="Module")return{content:`${i.label} is a module \u2014 the label is its repo path.`,miss:!1,ambiguous:!1,matches:t.matches};if(i.class==="Commit")return{content:`${i.label} is a commit, not a code location \u2014 try "what did commit ${i.label} touch".`,miss:!0,ambiguous:!1};let a=Ju(i,t.site);return a?{content:a,miss:!1,ambiguous:!1,matches:t.matches}:{content:`${i.label} has no recorded code location in this index \u2014 it carries no source site, and nothing places it in a module.`,miss:!0,ambiguous:!1}}if(t.whenShape){let i=t.objMatch.label;if(!t.matches.length)return{content:`no recorded commit touches ${i} in this index. ${Xs(n)}`,miss:!0,ambiguous:!1};let a=t.matches[0],c=(a.attributes||[]).find(p=>p.key==="date")?.value||"";if(!c)return{content:`commit ${a.label} touched ${i}, but this index records no commit dates \u2014 regenerate the graph to attach mgx:commitDate.`,miss:!0,ambiguous:!1};let l=(a.attributes||[]).find(p=>p.key==="message")?.value||"",u=String(c).slice(0,10);if(a.id===t.objMatch.id)return{content:`commit ${a.label} ${pi("is-dated",a.id,"is dated")} ${u}${l?` ("${l}")`:""}.`,miss:!1,ambiguous:!1,matches:t.matches};let d=t.matches.length-1;return{content:`${i} was last touched by commit ${a.label} on ${u}${l?` ("${l}")`:""}${d?`; ${d} earlier commit${d===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.whoLastShape){let i=t.objMatch.label;if(!t.matches.length)return{content:`no recorded commit touches ${i} in this index. ${Xs(n)}`,miss:!0,ambiguous:!1};let a=t.matches[0],c=(a.attributes||[]).find(u=>u.key==="author")?.value;if(!c)return{content:`commit ${a.label} last touched ${i}, but this index records no commit author \u2014 regenerate the graph to attach mgx:commitAuthor.`,miss:!0,ambiguous:!1};let l=t.matches.length-1;return{content:`${i} was last touched by ${c} (commit ${a.label})${l?`; ${l} earlier commit${l===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.commitSubject){let i=`commit ${t.objMatch.label}`;if(!t.matches.length)return{content:`${i} touched nothing recorded in the index.`,miss:!0,ambiguous:!1};let a=new Map;for(let u of t.matches.slice(0,rt)){let d=u.class||"Module";a.has(d)||a.set(d,[]),a.get(d).push(["Function","Method"].includes(d)?`${u.label}()`:u.label)}let c=[...a.entries()].map(([u,d])=>`${Ne(u,d.length)} ${Fn(d)}`),l=t.matches.length>rt?`; \u2026and ${t.matches.length-rt} more`:"";return{content:`${i} touched ${c.join("; ")}${l}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(e.shape==="ask"){if(!t.objMatch||!t.subjMatch)return{content:"couldn't resolve one of the terms in this question.",miss:!0,ambiguous:!1};let i=`${t.traversal}.`,a=`no ${e.kind} edge found from ${t.subjMatch.label} to ${t.objMatch.label}.`,c=e.negated?a:i,l=e.negated?i:a;return{content:`${t.answer?"Yes":"No"} \u2014 ${t.answer?c:l}`,miss:!t.matches.length,ambiguous:!1}}if(!t.matches.length){if(e.shape==="forward"){if(sr.includes(e.kind)&&n&&t.objMatch)for(let c of sr){if(c===e.kind)continue;let l={...e,kind:c},u=sn(n,l,{pinnedObjMatch:t.objMatch});if(u?.matches?.length&&!u.ambiguous)return Bb(l,u,n)}return{content:`${t.objMatch.label} has no ${ko(e.kind)} edges in the index.`,miss:!0,ambiguous:!1}}if(e.kind==="tests"&&!e.entityType)return{content:`No tests cover ${String(e.object||"").replace(f_,"").trim()||String(e.object||"").trim()}.`,miss:!0,ambiguous:!1};let i=e.entityType?Ne(e.entityType,2):(()=>{let c=[...sd(n,Mt(e.kind))];return c.length===1?Ne(c[0],2):c.length>1?c.map(l=>Ne(l,2)).join(" or "):Ne("Module",2)})(),a=t.objMatch&&bo.includes(String(e.object||"").toLowerCase())?t.objMatch.label:e.object;return{content:`No ${i} found whose module directly ${ko(e.kind)} ${a}. ${Xs(n)}`,miss:!0,ambiguous:!1}}if(e.polar&&t.matches.length===1)return{content:`Yes \u2014 ${t.objMatch?.label||e.object} is ${MT(e.kind)} by ${t.matches[0].label}.`,miss:!1,ambiguous:!1,matches:t.matches};if(e.shape==="forward"||e.entityType==="Module"||t.matches.every(i=>!Js.has(i.class))){let i=t.matches.slice(0,rt).map(c=>c.class==="Commit"?PT(c):c.label),a=t.matches.length>rt?`, \u2026and ${t.matches.length-rt} more`:"";return{content:i.join(" and ")+a+".",miss:!1,ambiguous:!1,matches:t.matches}}let s=new Map;for(let i of t.matches.slice(0,rt)){let a=Ao(i)||"no recorded module";s.has(a)||s.set(a,[]),s.get(a).push(Qu(i))}let o=[...s.entries()].map(([i,a],c)=>{let l=Fn(a);return c===0?`in ${i} there is ${l}`:`there is ${l} in ${i}`}),r=t.matches.length>rt?` \u2026and ${t.matches.length-rt} more`:"";return{content:o.join(" and ")+r+".",miss:!1,ambiguous:!1,matches:t.matches}}function Gb(e){if(e.length<4||UT.has(e))return null;let t=Ss(e),n=t+1,s=null,o=!1;for(let r of zT){let i=Es(e,r,Math.min(n,t));i<n?(n=i,s=r,o=!1):i===n&&i<=t&&r!==s&&(o=!0)}return n<=t&&!o?s:null}function ub(e,t){if(!e?.match||e.matchedVia!=="fuzzy"||e.ambiguous||!md(e.match))return!1;let n=String(t||"").trim().toLowerCase(),s=Gb(n);return!!s&&s!==n&&!!Qe[s]}function Vb(e,t,n){if(!t)return!1;if(t.ambiguousParse)return"ambiguous";if(t.node)return t.node!=="miss";if(t.shape==="meta"||t.shape==="mentions")return!0;let s=Rs(e,t.object,n);if(s.unresolvedPronoun)return"pronoun";if(!s.match||ub(s,t.object))return!1;if(t.shape==="ask"){let o=Rs(e,t.subject,n);return o.unresolvedPronoun?"pronoun":!!(o.match&&!ub(o,t.subject))}return!0}function BT(e){let t=String(e||"").trim().toLowerCase().replace(/[?.!\s]+$/,"");return Zm.includes(t)}function WT(e,t,{nlp:n=void 0,contextId:s=null,prev:o=null}={}){let r=ci(So(String(t||""))),i=nn(r);if(!i.length)return null;let a=[],c=[],l=w=>{let T=zn(e,w);return!!T.match&&T.tier!=null&&T.tier<=2},u=w=>{let T=zn(e,w);return!!T.match&&T.tier!=null&&T.tier<=3},d=w=>{let T=String(w||"").trim().toLowerCase();return bo.includes(T)?!0:nn(T).some(I=>{let j=I.toLowerCase();return!Ya.has(j)&&!ed.has(j)})},p=new Set(["reverse","forward","where","when","ask"]),f=w=>{let T=w.join(" "),I=To(T,{nlp:n});return Vb(e,I,s)!==!0||I&&!I.node&&p.has(I.shape)&&(I.object!=null&&!d(I.object)||I.shape==="ask"&&I.subject!=null&&!d(I.subject))||Dn(I,sn(e,I,{contextId:s,prev:o}),e).miss?null:{parsed:I,text:T}},m=w=>({parsed:w.parsed,from:r,to:w.text,dropped:[...a],steps:c}),h=0,g=Math.max(i.length,1)+12;for(;h<g;h+=1){let w=-1;for(let j=0;j<i.length;j+=1){let k=i[j].toLowerCase();if(hd.has(k)&&!Ya.has(k)&&!l(i[j])){w=j;break}}if(w<0)break;let T=i[w];i=i.filter((j,k)=>k!==w),a.push(T),c.push(`strip noise "${T}" \u2192 "${i.join(" ")}"`);let I=f(i);if(I)return m(I)}let b=To(i.join(" "),{nlp:n}),y=new Set;if(b&&!b.node&&p.has(b.shape))for(let w of[b.object,b.subject])for(let T of nn(String(w||"").toLowerCase()))y.add(T);let $=[],E=[],_=[];for(let w of i){let T=w.toLowerCase();if(!/^[a-z]+$/.test(T)||Ya.has(T)||ed.has(T)||u(w)){$.push(w);continue}let j=Gb(T);if(j&&j!==T){$.push(j),_.push(`${w}\u2192${j}`);continue}if(y.has(T)){$.push(w);continue}E.push(w)}if((_.length||E.length)&&$.length){i=$,a.push(...E),_.length&&c.push(`fuzzy-correct ${JSON.stringify(_)} \u2192 "${i.join(" ")}"`),E.length&&c.push(`drop unmatched ${JSON.stringify(E)} \u2192 "${i.join(" ")}"`);let w=f(i);if(w)return m(w)}let v=!1,S=i.map(w=>{let T=w.toLowerCase();return or[T]&&!u(w)?(v=!0,or[T]):w});if(v){c.push(`normalise synonyms \u2192 "${S.join(" ")}"`);let w=f(S);if(w)return m(w)}let C=nn(r).map(w=>w.toLowerCase()),x=[],R=[];for(let w of C){if(Wb.has(w))continue;let T=Qe[w];T&&T!=="Change"?x.push(w):R.push(w)}if(x.length===1&&R.length===0){let w=f(["count",x[0]]);if(w)return c.push(`bare kind "${x[0]}" \u2192 count`),m(w)}return null}function VT(e,t){let n=String(t||"");if(!e||!db.test(n))return n;let s=e.individuals.filter(c=>c.class==="Commit");if(!s.length)return n;let o=c=>String((c.attributes||[]).find(l=>l.key==="date")?.value||""),r=[...s].sort((c,l)=>o(l).localeCompare(o(c)))[0];if(!r)return n;let i=n.replace(db,`commit ${r.label}`),a=i.trim().replace(/[?.!]+$/,"");return GT.test(a)?`${a} touched`:i}function HT(e){let t=String(e||"").toLowerCase(),n=new Set([t]);return t.endsWith("ies")&&n.add(`${t.slice(0,-3)}y`),(t.endsWith("ses")||t.endsWith("es"))&&n.add(t.slice(0,-2)),t.endsWith("s")&&t.length>1&&n.add(t.slice(0,-1)),[...n]}function gd(e,t){let n=HT(t);for(let s of e?.individuals||[])if(s?.class&&n.includes(String(s.class).toLowerCase()))return s.class;return null}function YT(e,t){let n=String(t||"").trim(),s=n.match(qT),o=s?null:n.match(KT),r=s||o;if(!r||!bd.test(r[2]||"")||Qe[r[1].toLowerCase()])return null;let i=gd(e,r[1]);if(!i)return null;let a={node:"allOfClass",entityType:i};return s?{node:"list",entityType:i,base:a,scoped:!1}:{node:"count",entityType:i,base:a}}function XT(e,t){let n=String(t||"").split(/\s*,\s*|\s+and\s+/i).map(r=>r.trim()).filter(Boolean);if(!n.length)return null;let s=[],o=[];for(let r of n){let i=r.replace(/^(?:all\s+)?(?:the\s+)?/i,"").trim();if(!/^[a-z][a-z'-]*$/i.test(i))return null;let a=gd(e,i);if(!a)return null;s.push(i.toLowerCase()),o.push(a)}return{asked:[...new Set(s)],classes:[...new Set(o)]}}function eA(e,t){let n=String(t||"").trim().toLowerCase();if(!n)return null;let s=new Set;for(let o of e?.individuals||[])o?.id&&(String(o.id).toLowerCase()===n||String(o.label||"").toLowerCase()===n)&&s.add(o.id);return s.size===1?[...s][0]:null}function tA(e,t){let n=ga(String(t||"").trim()),s=n.match(JT),o=s?Gm[s[1].toLowerCase()]:"placement";if(!o)return null;let r=s?s[2]:n.match(QT)?.[1]||n.match(ZT)?.[1];if(!r)return null;let i={node:"worldRelation",relation:o,predicate:go[o].predicate},a=XT(e,r);if(a)return{...i,classes:a.classes,asked:a.asked};let c=eA(e,r);return c?{...i,subjects:[c],asked:[c]}:null}function nA(e,t){return go[e].matchesLocativePredicates?tr(bi(t.prop))||tr(bi(t.predicate)):null}function sA(e,t){let n=t.classes?new Set(t.classes):null,s=t.subjects?new Set(t.subjects):null,o=go[t.relation],r=bi(o.predicate),i=new Map,a=new Map;for(let l of e?.relations||[]){let u=bi(l.prop),d=bi(l.predicate),p=u===r||d===r,f=p?null:nA(t.relation,l);if(!(!p&&!f))for(let m of l.edges||[]){let h=e.byId?.get(m.subject);if(!h||!(s?s.has(m.subject):n.has(h.class)))continue;let b={subject:h,object:m.object,reads:p?o.reads:`is ${f}`};p?i.set(m.subject,b):a.set(`${u||d}\0${m.subject}`,b)}}let c=[...i.values(),...[...a.values()].filter(l=>!i.has(l.subject.id))].sort((l,u)=>String(l.subject.id).localeCompare(String(u.subject.id))||String(l.object).localeCompare(String(u.object)));return{compositeKind:"worldRelation",relation:t.relation,asked:t.asked,pairs:c,matches:c.map(l=>l.subject)}}function Bu(e){let t=oA.exec(String(e??""));return t?{base:t[1],epoch:t[2]?Number(t[2]):0,stamp:Number(t[3])}:{base:String(e??""),epoch:0,stamp:0}}function iA(e,{classOf:t=()=>null}={}){let n=new Map;for(let a of e||[])a?.predicate==="rdf:type"&&a.subject&&a.object&&n.set(Bu(a.subject).base,String(a.object));let s=new Set(Vm),o=new Map,r=new Map;for(let a of e||[]){if(!a?.subject||!s.has(a.predicate))continue;let{base:c,epoch:l,stamp:u}=Bu(a.subject),d=n.get(c)||t(c);if(!d)continue;let p=`${a.predicate}\0${c}`;rA(r.get(p),l,u)&&(o.set(c,{id:c,label:c,class:d}),r.set(p,{epoch:l,stamp:u,predicate:a.predicate,subject:c,object:Bu(a.object).base}))}let i=new Map;for(let a of r.values())i.has(a.predicate)||i.set(a.predicate,{prop:a.predicate,predicate:a.predicate,examples:[]}),i.get(a.predicate).examples.push({subject:a.subject,object:a.object});return{individuals:[...o.values()],objectProperties:[...i.values()]}}function lA(e,t,n){let s=String(t?.object||"").trim();if(!s)return!1;let o=gd(e,s);if(!o)return!1;let r=[n.objMatch,...n.candidates||[]].filter(Boolean),i=new Set(r.map(c=>c.id));if(i.size<2)return!1;let a=new Map;for(let c of e?.individuals||[])c?.id&&(a.has(c.id)||a.set(c.id,new Set),a.get(c.id).add(c.class));return[...i].every(c=>c===o||a.get(c)?.has(o))}function Zs(e,t,{contextId:n=null,nlp:s=void 0,prev:o=null}={}){if(BT(t))return{content:dd(),tmct_ask:{mechanical:!0,parsed:null,canonical:null,matches:[],traversal:null,miss:!0,ambiguous:!1,matchedVia:null,help:!0,relaxed:null}};t=VT(e,t);let r=td(t,{nlp:s}),i=r.parsed,a=i,c=null;if(Vb(e,i,n)===!1){let p=WT(e,t,{nlp:s,contextId:n,prev:o});p&&(a=p.parsed,c={from:p.from,to:p.to,dropped:p.dropped,steps:p.steps})}let l=sn(e,a,{contextId:n,prev:o}),u=Dn(a,l,e);if(fb(e,a,l,u)){let p=YT(e,t);if(p){let f=sn(e,p,{contextId:n,prev:o}),m=Dn(p,f,e);m.miss||(a=p,l=f,u=m,c=null)}}if(fb(e,a,l,u)){let p=tA(e,t);if(p){let f=sn(e,p,{contextId:n,prev:o}),m=Dn(p,f,e);m.miss||(a=p,l=f,u=m,c=null)}}if(a===null&&u.miss&&!u.ambiguous){let f=Pa(String(t||"")).trim().match(aA)?.[1]?.trim();if(f&&!/\s+(?:for|about)$/i.test(f)){let m=To(`what is a ${f}`,{nlp:s});m?.shape==="meta"&&(l=sn(e,m,{contextId:n,prev:o}),u=Dn(m,l,e))}}if(a===null&&u.miss&&!u.ambiguous){let f=So(String(t||"")).match(cA)?.[1]?.trim();if(f){let m=To(`what is a ${f}`,{nlp:s});if(m?.shape==="meta"){let h=sn(e,m,{contextId:n,prev:o}),g=Dn(m,h,e);!g.miss&&!g.ambiguous&&(l=h,u=g)}}}let d=c&&!u.miss&&c.to!==c.from?`read as "${c.to}" \u2014 ${u.content}`:u.content;if(!c&&!u.miss&&!u.ambiguous&&r.alternates.length){let p=r.alternates.map(f=>{let m=sn(e,f.parsed,{contextId:n,prev:o}),h=Dn(f.parsed,m,e);return h.miss?null:{a:f,text:h.content}}).filter(Boolean);if(p.length){let f=Hg(p.map(m=>m.a),{answerFor:m=>p.find(h=>h.a===m)?.text||null});d=`${d}
60
- ${f.join(`
61
- `)}`}}if(!u.ambiguous&&l.objMatch&&Array.isArray(l.candidates)&&l.candidates.length){let p=new Set((l.matches||[]).map(m=>m&&m.id)),f=l.candidates.filter(m=>m&&m.id&&m.id!==l.objMatch.id&&!p.has(m.id));if(f.length){let m=f.slice(0,3).map(b=>b.label).filter(Boolean),h=f.length-m.length,g=m.join(", ")+(h>0?`, +${h} more`:"");d=`${d}
62
- (answering for ${l.objMatch.label} \u2014 ${f.length} other match${f.length===1?"":"es"}: ${g})`}}return!Array.isArray(l.referents)&&!u.miss&&!u.ambiguous&&(a?.shape==="reverse"||a?.shape==="forward")&&a.entityType&&Array.isArray(l.matches)&&l.matches.length&&l.matches.every(p=>p&&p.class===a.entityType)&&(l={...l,referents:wi(a.entityType,l.matches,"relationListing")}),{content:d,tmct_ask:{mechanical:!0,parsed:a&&!a.ambiguousParse?a:null,canonical:Ub(a),matches:(l.matches||[]).map(p=>({id:p.id,label:p.label,type:p.class,module:p.class?Ao(p):void 0})),traversal:l.traversal||null,miss:!!u.miss,ambiguous:!!u.ambiguous,relaxed:c,matchedVia:l.matchedVia||null,...Array.isArray(l.referents)&&l.referents.length?{discourse:l.referents}:{},...u.ambiguous?{candidates:u.candidates,candidateParses:u.candidateParses}:{}}}}var Jg,br,Js,Du,c_,Mt,pb,rt,Wu,l_,u_,d_,f_,p_,h_,mb,hb,Gu,b_,Qs,nd,ut,gb,y_,v_,E_,j_,k_,__,T_,A_,C_,O_,N_,rd,L_,P_,F_,xb,ad,Eb,Sb,q_,X_,Qg,Zg,eT,Tb,eb,nT,tb,iT,sb,rb,lT,dT,pT,js,zu,RT,_T,TT,pd,AT,cb,CT,lb,NT,Ya,ed,hd,Wb,DT,zT,UT,db,GT,qT,KT,bd,JT,QT,ZT,bi,oA,rA,aA,cA,fb,Jn=M(()=>{De();gu();Kn();Sn();fr();Da();za();Xg();Pu();qs();fi();Fu();hr();Jg=new WeakMap;br={calls:"callsSymbol",touches:"touchesSymbol"},Js=new Set(["Function","Method","Class","Attribute","GlobalVariable"]),Du={Function:"Method",Method:"Function"},c_={uses:["imports","calls","callsSymbol"]},Mt=e=>c_[e]||[e],pb=new Set(Object.values(br)),rt=12,Wu={Function:["function","functions"],Method:["method","methods"],Class:["class","classes"],Module:["module","modules"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"],Change:["change","changes"],Package:["package","packages"],Fact:["fact","facts"],Utterance:["utterance","utterances"],Session:["session","sessions"],Source:["source","sources"],Rule:["rule","rules"]};l_={cochange:"cochanges",reexports:"export"};u_={imports:"import",calls:"call",callsSymbol:"call",inherits:"inherit from",contains:"contain",tests:"test",touches:"touch",cochange:"cochange",reexports:"export",uses:"use",serves:"serve",denotes:"denote"},d_=e=>u_[e]||ko(e),f_=new RegExp(`^(?:${Object.keys(me).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})(?:s|ing|ed)?\\s+`,"i"),p_=new Set(["imports"]);h_=/^where\s+(?:does|do|did)\s+/i,mb=new Set(ge(fn));hb=4,Gu="zzinnerset",b_=new Set(["that","which","who","are","is","was","were","do","does","also","still","both","and","then","though"]),Qs=new Set(["which","what","who","list","show","find","give","me","us","all"]),nd=new Set(["are","is","was","were"]);ut=e=>Qe[e]?{entityType:Qe[e],placeholder:!1}:bs.includes(e)?{entityType:null,placeholder:!0}:null,gb=e=>!!me[e]&&e.endsWith("ing");y_=new Set(["which","the","all"]);v_=new Set(["all","every","each"]);E_=new Set(["what","which","thing","things","one","ones","stuff"]);j_=new Set(["defined","declared"]);k_=new Set(["those","them"]);__=new Set(["did","was","were","do","does","has","have","had"]),T_=new Set(["change","changed","changes","update","updated","updates","modify","modified","modifies","touch","touched","touches","edit","edited","revise","revised"]),A_=new Set(["last","recently","ever","get","got","been","then","now","already"]),C_=new Set(["the","a","an","all","those","these","any"]);O_=new Set(["since","before","after","on"]),N_=new Set(["what","which"]);rd=new Set(["the","a","an","all","those","these","any"]);L_=new Set(["is","are","was","were","does","do","did"]),P_=new Set(["the","a","an","all","those","these","any"]);F_=/\b[\w-]+(?:[/.][\w-]+)+\b|\b[A-Z][A-Za-z0-9_]*\b|\b[a-z][a-z0-9]*[A-Z][A-Za-z0-9]*\b/;xb=new Set(["total","altogether","overall","exist","exists","existing","present","here","now","currently","graph","index","codebase","repo","repository","this","that"]);ad=new Set(["the","a","an","all","me","us"]),Eb=[...$o].sort((e,t)=>t.split(" ").length-e.split(" ").length),Sb="functions, classes, methods, modules, packages, attributes, variables, or commits",q_=new Set(["in","inside","under"]);X_=new Set(["called","named","about","like","containing","matching","with"]);Qg=new Set(["recent","latest","newest"]);Zg=new WeakMap;eT=new Set(["defines","contains"]),Tb=(e,t)=>t==="Module"&&Mt(e).some(n=>eT.has(n)),eb=new WeakMap;nT=/^git:(.+)$/i;tb=new WeakMap;iT=new Set(["Class","Function","Method","GlobalVariable","Attribute"]);sb=new WeakMap;rb={label:3,chain:2,attr:1};lT=e=>e&&typeof e.value=="boolean"?{...e,value:!e.value}:null;dT=["imports","calls","callsSymbol","inherits","contains","tests"];pT=/^\d{4}-\d{2}-\d{2}$/;js=e=>Fn(e.slice(0,rt).map(t=>["Function","Method"].includes(t.class)?`${t.label}()`:t.label))+(e.length>rt?`, \u2026and ${e.length-rt} more`:"");zu=10;RT=/^(?:the|a|an)\s+/i,_T=new RegExp(`\\s+(${Object.keys(Qe).join("|")})$`,"i");TT=/^(?:the\s+)?(?:main\s+|primary\s+)?entry[\s-]?points?(?:\s+(?:of|to|for)\s+(?:this|the)\s+(?:codebase|code|repo|repository|project|app))?$/i,pd=new Set(["index","main","app","server","cli","__main__"]),AT=new Set(["test","tests","__tests__","fixture","fixtures","spec","specs","testdata"]),cb=e=>String(e).toLowerCase().split("/").pop().replace(/\.[a-z0-9]+$/,""),CT=e=>String(e).toLowerCase().split("/").slice(0,-1).some(t=>AT.has(t));lb=8,NT=new Set(["mgx:schemaDoc","mgx:lexiconDoc"]);Ya=new Set([...ge(Object.keys(me)),...ge(Object.keys(Qe)),...ge(Object.keys(mn)),...ge(Object.keys(ct)),...ge(yo),...ge(Object.keys(Hn)),...ge(Object.keys(qn)),...ge(Object.keys(nr)),...ge(bs),...ge(ei),...ge(wo),...ge(fn),...ge(Ln),...ge(vn),...ge(Object.keys(or)),...ge([...ba])]),ed=new Set([...dt,...Qs,...bo]),hd=new Set(ge(ya)),Wb=new Set([...hd,...ed]),DT=["many","count","number","quantity","total","tally","list","show","display","print","dump","enumerate","name"],zT=[...new Set([...ge(Object.keys(me)),...Object.keys(Qe),...DT])].filter(e=>/^[a-z]+$/.test(e)&&e.length>=4&&!dt.has(e)),UT=new Set(["impact","impacts","impacted"]);db=/\b(?:the\s+)?(?:last|latest|most\s+recent)\s+commit\b/i,GT=/^when\s+(?:was|were|is|did|does|do)\s+commit\s+[0-9a-fA-F:]+$/i;qT=/^(?:list|show(?:\s+me)?)\s+(?:all\s+|the\s+)?([a-z][a-z'-]*)\s*(.*)$/i,KT=/^(?:how\s+many|number\s+of|count(?:\s+the)?)\s+([a-z][a-z'-]*)\s*(.*)$/i,bd=/^(?:are there(?:\s+in\s+total)?|is there|do you know(?:\s+about)?|do you have|exist(?:s)?|are known|in (?:the |a )?(?:graph|memory)|you know(?:\s+about)?)?[?.!\s]*$/i;JT=new RegExp(`^(?:${Eb.map(ot).join("|")})\\s+(?:all\\s+)?(?:the\\s+)?([a-z][a-z'-]*)\\s+(?:of|for)\\s+(.+?)[?.!\\s]*$`,"i"),QT=/^where(?:'s|\s+is|\s+are)\s+(?:all\s+)?(?:the\s+)?(.+?)[?.!\s]*$/i,ZT=/^where\s+(?:does|do|did)\s+(?:all\s+)?(?:the\s+)?(.+?)\s+[a-z][a-z'-]*[?.!\s]*$/i;bi=e=>String(e||"").toLowerCase();oA=/^(.+?)@(?:epoch(\d+)@)?(?:turn|step)(\d+)$/;rA=(e,t,n)=>!e||e.epoch<t||e.epoch===t&&e.stamp<=n;aA=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,cA=/^what\s+is\s+(?:the\s+)?(?!(?:an?|it|this|that|these|those)\s)(.+?)\s+(?:used\s+)?for[?.!\s]*$/i;fb=(e,t,n,s)=>s.ambiguous?lA(e,t,n):!!s.miss});function eo(e,t,n,s){let o=Math.max(1,t),r=Math.min(e.length,n),i=!1;s!=null&&r-o+1>s&&(r=o+s-1,i=!0);let a=e.slice(o-1,r).map((c,l)=>`${o+l} ${c}`).join(`
63
- `);return{start:o,end:r,text:a,truncated:i}}async function Ts({readFile:e,repoRoot:t,path:n,start:s,end:o,maxLines:r}){let i=Gt(t),a=Gt(i,n);if(a!==i&&!a.startsWith(i+Dm))throw new Oe(`refusing to read outside the repository root: ${n}`);let l=(await e(a,"utf8")).split(`
64
- `);return s==null||o==null?{lines:l}:{lines:l,...eo(l,s,o,r)}}var Qa=M(()=>{Je();Kt()});function At(e){return{ok:!0,value:e}}function Ct(e,{detail:t="",term:n=null}={}){if(!ht[e])throw new TypeError(`miss(): unknown reason "${e}" (not in MISS_REASONS)`);return{ok:!1,miss:{reason:e,detail:t,term:n}}}function Qn(e){return!e||!e.id?null:{id:String(e.id),label:e.label!=null?String(e.label):String(e.id),class:e.class||"Entity",attributes:(Array.isArray(e.attributes)?e.attributes:[]).map(t=>({key:t.key,value:t.value,prop:t.prop||null}))}}function Za(e,{predicate:t="",prop:n=null}={}){let s={subject:e.subject,object:e.object,predicate:t,prop:n||null};return e.subjectLabel!=null&&(s.subjectLabel=e.subjectLabel),e.objectLabel!=null&&(s.objectLabel=e.objectLabel),e.weight!=null&&(s.weight=e.weight),s}var yd,uA,ht,$d,Tz,qb,vd,dA,Un,wd,Ht,Az,Kb=M(()=>{yd="1.1.0",uA="urn:tmct:core",ht=Object.freeze({UNRESOLVED_TERM:"UNRESOLVED_TERM",CAPABILITY_ABSENT:"CAPABILITY_ABSENT",TRUNCATED_GRAPH:"TRUNCATED_GRAPH",NO_SOURCE:"NO_SOURCE"}),$d=Object.freeze(["imports","calls","callsSymbol","defines","tests","touches","touchesSymbol","contains","inherits","cochange","reexports","serves","denotes"]),Tz=Object.freeze({imports:"tmct:imports",calls:"tmct:calls",callsSymbol:"tmct:calls",defines:"tmct:defines",tests:"tmct:covers",touches:"tmct:touches",touchesSymbol:"tmct:touches",contains:"tmct:contains",inherits:"tmct:extends",cochange:"tmct:dependsOn",reexports:"tmct:exports",serves:"tmct:serves",denotes:"tmct:denotes"}),qb=Object.freeze({resolution:["resolve","describe","members","subclasses","exports","signature"],traversal:["edges","impact"],source:["snippet","context"],aggregate:["architecture","untested","stats"],temporal:["history"],search:["search","ask"]}),vd=Object.freeze(Object.values(qb).flat()),dA=Object.freeze(new Set(qb.source));Un="Individual",wd="Edge",Ht="concurrent-safe: reads immutable graph truth; no shared mutable state",Az=Object.freeze({version:yd,ontology:uA,missReasons:Object.values(ht),edgeKinds:[...$d],types:{Individual:{fields:{id:"string (opaque provider id)",label:"string (human/display name)",class:"string \u2014 a tmct: class token (module|class|function|method|attribute|variable|commit|test|\u2026)",attributes:"Array<{ key: string, value: string, prop: string|null }> \u2014 prop is the SEON/mgx token grounding the value"}},Edge:{fields:{subject:"string (individual id)",object:"string (individual id)",predicate:"string \u2014 the relation predicate",prop:"string|null \u2014 the SEON/mgx property token; see edgeKinds \u2192 tmct: mapping",subjectLabel:"string? (additive)",objectLabel:"string? (additive)",weight:"number? (additive; e.g. cochange coupling)"}},Result:{shape:"{ ok: true, value: T } | { ok: false, miss: Miss }"},Miss:{shape:"{ reason: MISS_REASONS, detail: string, term: string|null }"}},capabilitiesModel:"A provider advertises `capabilities: string[]` (service names it implements). A service outside the set is negotiated away to miss(CAPABILITY_ABSENT) \u2014 never an error. snippet may be advertised yet answer miss(NO_SOURCE) when no working tree exists (it has nothing useful without fs); context is graph-only-capable since INTERFACE_VERSION 1.1.0 \u2014 it returns a real hit (graph-only bundle) for any resolvable symbol even with no working tree, only escalating NO_SOURCE-style behavior to richer body text when source-capable.",services:{resolve:{group:"resolution",args:{term:"string"},result:`{ match: ${Un}, candidates: ${Un}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"The resolveSymbol seam: map a free term to an individual + runner-up candidates. Every id-taking service consumes a resolved id."},describe:{group:"resolution",args:{id:"string"},result:`{ individual: ${Un}, out: ${wd}[], incoming: ${wd}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"Full typed portrait of one individual: its attributes and its outgoing/incoming edges."},members:{group:"resolution",args:{classId:"string"},result:`{ methods: ${Un}[], attributes: ${Un}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"A class's methods + attributes (via the contains relation) \u2014 replaces reading the class body."},subclasses:{group:"resolution",args:{classId:"string"},result:`{ bases: ${Un}[], subclasses: ${Un}[], levels: Array<${Un}[]> }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"Forward bases + the transitive reverse inheritance closure (who extends this). `subclasses` is the flat closure; `levels` groups the same individuals by inheritance depth (direct children first), mirroring `impact`'s leveled shape."},exports:{group:"resolution",args:{moduleId:"string"},result:`{ exports: ${Un}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"A module's curated public API (resolved __all__ / re-exports)."},signature:{group:"resolution",args:{id:"string"},result:"{ id, label, class, params, returns, raises, decorators, doc, selfFields, flags }",misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"The compact API surface of a symbol without its body."},edges:{group:"traversal",args:{id:"string",kind:"EDGE_KINDS member"},result:`{ kind: string, edges: ${wd}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"Outgoing edges of one closed kind from an individual (an honest empty array is not a miss).",note:"An unknown kind (outside EDGE_KINDS) is a programming error and throws TypeError, not a miss."},impact:{group:"traversal",args:{moduleId:"string"},result:"{ total: number, levels: Array<Array<{ id, label, via, tests }>> }",misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"The transitive dependent closure the interpreter cannot compute without provider truth."},snippet:{group:"source",args:{id:"string"},result:"{ path: string, span: { start, end }, body: string|null } \u2014 Promise<Result>",misses:["UNRESOLVED_TERM","NO_SOURCE"],concurrency:Ht,purpose:"The exact source span of a symbol. A provider with no working tree returns miss(NO_SOURCE) honestly \u2014 snippet has nothing useful without fs.",note:"ASYNC (returns Promise<Result>) \u2014 a real body read is inherently fs I/O; callers should always await it. A graph-only provider still resolves synchronously-in-spirit (the promise settles on the same tick) but the return type is uniformly a Promise regardless of sourceAccess."},context:{group:"source",args:{symbol:"string",depth:"min|auto|full?"},result:"{ text: string, tier: string } (a sized edit bundle) \u2014 Promise<Result>",misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"The composed edit bundle (exemplar, siblings, registration, insertion region). A graph-only provider returns the graph-only sections as a real hit; a source-capable provider (sourceAccess:true, repoRoot, readFile) additionally includes the anchor/exemplar/inlined-callee body text.",note:"ASYNC (returns Promise<Result>) \u2014 see snippet's note; source-capable rendering is fs I/O."},architecture:{group:"aggregate",args:{package:"string?"},result:"{ modules: number, packages: Array<[dir, count]>, hubs: Array<{ id, label, importers }> }",misses:[],concurrency:Ht,purpose:"Package/module shape + the most-imported hub modules. Optional package prefix scopes it."},untested:{group:"aggregate",args:{},result:`{ modules: ${Un}[] }`,misses:[],concurrency:Ht,purpose:"Modules with no covering test module (via the tests relation)."},stats:{group:"aggregate",args:{},result:"{ total: number, classes: Array<{ class: string, count: number }>, truncated: boolean }",misses:[],concurrency:Ht,purpose:"Per-tmct:class individual counts, read straight from the payload."},history:{group:"temporal",args:{id:"string"},result:"{ commits: Array<{ id, label, author, date, message }> }",misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"The commits that touched an individual (tmct:commit individuals via tmct:touches)."},search:{group:"search",args:{query:"string",kind:"string?",name:"string?",decorator:"string?"},result:`{ results: ${Un}[] }`,misses:[],concurrency:Ht,purpose:"Lexical, provider-local locate. An empty result set is honest, not a miss."},ask:{group:"search",args:{query:"string"},result:"{ content: string, tmct_ask: object } (the composed NL round-trip envelope)",misses:[],concurrency:Ht,purpose:"The mechanical, zero-model NL query over the graph \u2014 tmct's whole reason to exist."}}})});function fA(e,t){let n=[],s=[];for(let o of e.relations)for(let r of o.edges)r.subject===t&&n.push(Za(r,{predicate:o.predicate,prop:o.prop})),r.object===t&&s.push(Za(r,{predicate:o.predicate,prop:o.prop}));return{out:n,incoming:s}}function pA(e,t){for(let n of e.relations)if(xs(n)===t)return{predicate:n.predicate,prop:n.prop};return{predicate:t,prop:null}}async function hA(e,t,{readFile:n,repoRoot:s}){if(!e.moduleLabel)return"";let o=null;try{({lines:o}=await Ts({readFile:n,repoRoot:s,path:e.moduleLabel}))}catch{o=null}if(!o)return"";let r=[];if(t.anchor&&e.anchor?.site){let{start:i,end:a}=e.anchor.site;r.push(`
65
- ## anchor: ${e.anchor.label} (${e.anchor.class}) @ ${e.moduleLabel}:${i}-${a}`),r.push(eo(o,i,a,xd).text),e.callHint&&r.push(e.callHint)}if(t.exemplar&&e.exemplar?.site){let{start:i,end:a}=e.exemplar.site,c=e.exemplar.decorators?` @${e.exemplar.decorators}`:"";r.push(`
66
- ## closest example (full body) \u2014 copy this style: ${e.exemplar.label} (${e.exemplar.class})${c} @ ${e.moduleLabel}:${i}-${a}`),r.push(eo(o,i,a,xd).text),e.callHint&&r.push(e.callHint)}if(t.inlinedCallees&&e.calleeBodies.length){let i=mA;for(let a of e.calleeBodies){if(i<=0)break;let c=a.site.start,u=a.site.path===e.moduleLabel?o:null;if(!u)try{({lines:u}=await Ts({readFile:n,repoRoot:s,path:a.site.path}))}catch{u=null}if(!u)continue;let d=eo(u,c,a.site.end,i);r.push(`
59
+ `)}`:p,miss:!1,ambiguous:!0,candidates:i.map(b=>b.label)}}if(t.whereShape){let i=t.objMatch;if(i.class==="Module")return{content:`${i.label} is a module \u2014 the label is its repo path.`,miss:!1,ambiguous:!1,matches:t.matches};if(i.class==="Commit")return{content:`${i.label} is a commit, not a code location \u2014 try "what did commit ${i.label} touch".`,miss:!0,ambiguous:!1};let a=td(i,t.site);return a?{content:a,miss:!1,ambiguous:!1,matches:t.matches}:{content:`${i.label} has no recorded code location in this index \u2014 it carries no source site, and nothing places it in a module.`,miss:!0,ambiguous:!1}}if(t.whenShape){let i=t.objMatch.label;if(!t.matches.length)return{content:`no recorded commit touches ${i} in this index. ${Xs(n)}`,miss:!0,ambiguous:!1};let a=t.matches[0],c=(a.attributes||[]).find(p=>p.key==="date")?.value||"";if(!c)return{content:`commit ${a.label} touched ${i}, but this index records no commit dates \u2014 regenerate the graph to attach mgx:commitDate.`,miss:!0,ambiguous:!1};let l=(a.attributes||[]).find(p=>p.key==="message")?.value||"",u=String(c).slice(0,10);if(a.id===t.objMatch.id)return{content:`commit ${a.label} ${hi("is-dated",a.id,"is dated")} ${u}${l?` ("${l}")`:""}.`,miss:!1,ambiguous:!1,matches:t.matches};let d=t.matches.length-1;return{content:`${i} was last touched by commit ${a.label} on ${u}${l?` ("${l}")`:""}${d?`; ${d} earlier commit${d===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.whoLastShape){let i=t.objMatch.label;if(!t.matches.length)return{content:`no recorded commit touches ${i} in this index. ${Xs(n)}`,miss:!0,ambiguous:!1};let a=t.matches[0],c=(a.attributes||[]).find(u=>u.key==="author")?.value;if(!c)return{content:`commit ${a.label} last touched ${i}, but this index records no commit author \u2014 regenerate the graph to attach mgx:commitAuthor.`,miss:!0,ambiguous:!1};let l=t.matches.length-1;return{content:`${i} was last touched by ${c} (commit ${a.label})${l?`; ${l} earlier commit${l===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.commitSubject){let i=`commit ${t.objMatch.label}`;if(!t.matches.length)return{content:`${i} touched nothing recorded in the index.`,miss:!0,ambiguous:!1};let a=new Map;for(let u of t.matches.slice(0,rt)){let d=u.class||"Module";a.has(d)||a.set(d,[]),a.get(d).push(["Function","Method"].includes(d)?`${u.label}()`:u.label)}let c=[...a.entries()].map(([u,d])=>`${Te(u,d.length)} ${gn(d)}`),l=t.matches.length>rt?`; \u2026and ${t.matches.length-rt} more`:"";return{content:`${i} touched ${c.join("; ")}${l}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(e.shape==="ask"){if(!t.objMatch||!t.subjMatch)return{content:"couldn't resolve one of the terms in this question.",miss:!0,ambiguous:!1};let i=`${t.traversal}.`,a=`no ${e.kind} edge found from ${t.subjMatch.label} to ${t.objMatch.label}.`,c=e.negated?a:i,l=e.negated?i:a;return{content:`${t.answer?"Yes":"No"} \u2014 ${t.answer?c:l}`,miss:!t.matches.length,ambiguous:!1}}if(!t.matches.length){if(e.shape==="forward"){if(or.includes(e.kind)&&n&&t.objMatch)for(let l of or){if(l===e.kind)continue;let u={...e,kind:l},d=on(n,u,{pinnedObjMatch:t.objMatch});if(d?.matches?.length&&!d.ambiguous)return Hb(u,d,n)}return{content:`${t.objMatch.label} has no ${Qs(e.kind)} edges in the index.`,miss:!0,ambiguous:!1}}if(e.kind==="tests"&&!e.entityType)return{content:`No tests cover ${String(e.object||"").replace(b_,"").trim()||String(e.object||"").trim()}.`,miss:!0,ambiguous:!1};let i=e.entityType?Te(e.entityType,2):(()=>{let l=[...id(n,At(e.kind))];return l.length===1?Te(l[0],2):l.length>1?l.map(u=>Te(u,2)).join(" or "):Te("Module",2)})(),a=t.objMatch&&wo.includes(String(e.object||"").toLowerCase())?t.objMatch.label:e.object,c=e.modifier==="transitive"?"transitively":"directly";return{content:`No ${i} found whose module ${c} ${Qs(e.kind)} ${a}. ${Xs(n)}`,miss:!0,ambiguous:!1}}if(e.polar&&t.matches.length===1)return{content:`Yes \u2014 ${t.objMatch?.label||e.object} is ${GT(e.kind)} by ${t.matches[0].label}.`,miss:!1,ambiguous:!1,matches:t.matches};if(e.shape==="forward"||e.entityType==="Module"||t.matches.every(i=>!Js.has(i.class))){let i=t.matches.slice(0,rt).map(c=>c.class==="Commit"?WT(c):c.label),a=t.matches.length>rt?`, \u2026and ${t.matches.length-rt} more`:"";return{content:i.join(" and ")+a+".",miss:!1,ambiguous:!1,matches:t.matches}}let s=new Map;for(let i of t.matches.slice(0,rt)){let a=Co(i)||"no recorded module";s.has(a)||s.set(a,[]),s.get(a).push(nd(i))}let o=[...s.entries()].map(([i,a],c)=>{let l=gn(a);return c===0?`in ${i} there is ${l}`:`there is ${l} in ${i}`}),r=t.matches.length>rt?` \u2026and ${t.matches.length-rt} more`:"";return{content:o.join(" and ")+r+".",miss:!1,ambiguous:!1,matches:t.matches}}function Kb(e){if(e.length<4||KT.has(e))return null;let t=Ss(e),n=t+1,s=null,o=!1;for(let r of qT){let i=Es(e,r,Math.min(n,t));i<n?(n=i,s=r,o=!1):i===n&&i<=t&&r!==s&&(o=!0)}return n<=t&&!o?s:null}function mb(e,t){if(!e?.match||e.matchedVia!=="fuzzy"||e.ambiguous||!bd(e.match))return!1;let n=String(t||"").trim().toLowerCase(),s=Kb(n);return!!s&&s!==n&&!!Ze[s]}function Yb(e,t,n){if(!t)return!1;if(t.ambiguousParse)return"ambiguous";if(t.node)return t.node!=="miss";if(t.shape==="meta"||t.shape==="mentions")return!0;let s=Rs(e,t.object,n);if(s.unresolvedPronoun)return"pronoun";if(!s.match||mb(s,t.object))return!1;if(t.shape==="ask"){let o=Rs(e,t.subject,n);return o.unresolvedPronoun?"pronoun":!!(o.match&&!mb(o,t.subject))}return!0}function YT(e){let t=String(e||"").trim().toLowerCase().replace(/[?.!\s]+$/,"");return nh.includes(t)}function XT(e,t,{nlp:n=void 0,contextId:s=null,prev:o=null}={}){let r=ui(jo(String(t||""))),i=sn(r);if(!i.length)return null;let a=[],c=[],l=w=>{let T=wn(e,w);return!!T.match&&T.tier!=null&&T.tier<=2},u=w=>{let T=wn(e,w);return!!T.match&&T.tier!=null&&T.tier<=3},d=w=>{let T=String(w||"").trim().toLowerCase();return wo.includes(T)?!0:sn(T).some(I=>{let j=I.toLowerCase();return!Ja.has(j)&&!sd.has(j)})},p=new Set(["reverse","forward","where","when","ask"]),f=w=>{let T=w.join(" "),I=To(T,{nlp:n});return Yb(e,I,s)!==!0||I&&!I.node&&p.has(I.shape)&&(I.object!=null&&!d(I.object)||I.shape==="ask"&&I.subject!=null&&!d(I.subject))||zn(I,on(e,I,{contextId:s,prev:o}),e).miss?null:{parsed:I,text:T}},m=w=>({parsed:w.parsed,from:r,to:w.text,dropped:[...a],steps:c}),h=0,g=Math.max(i.length,1)+12;for(;h<g;h+=1){let w=-1;for(let j=0;j<i.length;j+=1){let k=i[j].toLowerCase();if(wd.has(k)&&!Ja.has(k)&&!l(i[j])){w=j;break}}if(w<0)break;let T=i[w];i=i.filter((j,k)=>k!==w),a.push(T),c.push(`strip noise "${T}" \u2192 "${i.join(" ")}"`);let I=f(i);if(I)return m(I)}let b=To(i.join(" "),{nlp:n}),y=new Set;if(b&&!b.node&&p.has(b.shape))for(let w of[b.object,b.subject])for(let T of sn(String(w||"").toLowerCase()))y.add(T);let $=[],E=[],_=[];for(let w of i){let T=w.toLowerCase();if(!/^[a-z]+$/.test(T)||Ja.has(T)||sd.has(T)||u(w)){$.push(w);continue}let j=Kb(T);if(j&&j!==T){$.push(j),_.push(`${w}\u2192${j}`);continue}if(y.has(T)){$.push(w);continue}E.push(w)}if((_.length||E.length)&&$.length){i=$,a.push(...E),_.length&&c.push(`fuzzy-correct ${JSON.stringify(_)} \u2192 "${i.join(" ")}"`),E.length&&c.push(`drop unmatched ${JSON.stringify(E)} \u2192 "${i.join(" ")}"`);let w=f(i);if(w)return m(w)}let v=!1,S=i.map(w=>{let T=w.toLowerCase();return rr[T]&&!u(w)?(v=!0,rr[T]):w});if(v){c.push(`normalise synonyms \u2192 "${S.join(" ")}"`);let w=f(S);if(w)return m(w)}let C=sn(r).map(w=>w.toLowerCase()),x=[],R=[];for(let w of C){if(qb.has(w))continue;let T=Ze[w];T&&T!=="Change"?x.push(w):R.push(w)}if(x.length===1&&R.length===0){let w=f(["count",x[0]]);if(w)return c.push(`bare kind "${x[0]}" \u2192 count`),m(w)}return null}function QT(e,t){let n=String(t||"");if(!e||!hb.test(n))return n;let s=e.individuals.filter(c=>c.class==="Commit");if(!s.length)return n;let o=c=>String((c.attributes||[]).find(l=>l.key==="date")?.value||""),r=[...s].sort((c,l)=>o(l).localeCompare(o(c)))[0];if(!r)return n;let i=n.replace(hb,`commit ${r.label}`),a=i.trim().replace(/[?.!]+$/,"");return JT.test(a)?`${a} touched`:i}function ZT(e){let t=String(e||"").toLowerCase(),n=new Set([t]);return t.endsWith("ies")&&n.add(`${t.slice(0,-3)}y`),(t.endsWith("ses")||t.endsWith("es"))&&n.add(t.slice(0,-2)),t.endsWith("s")&&t.length>1&&n.add(t.slice(0,-1)),[...n]}function yd(e,t){let n=ZT(t);for(let s of e?.individuals||[])if(s?.class&&n.includes(String(s.class).toLowerCase()))return s.class;return null}function nA(e,t){let n=String(t||"").trim(),s=n.match(eA),o=s?null:n.match(tA),r=s||o;if(!r||!$d.test(r[2]||"")||Ze[r[1].toLowerCase()])return null;let i=yd(e,r[1]);if(!i)return null;let a={node:"allOfClass",entityType:i};return s?{node:"list",entityType:i,base:a,scoped:!1}:{node:"count",entityType:i,base:a}}function sA(e,t){let n=String(t||"").split(/\s*,\s*|\s+and\s+/i).map(r=>r.trim()).filter(Boolean);if(!n.length)return null;let s=[],o=[];for(let r of n){let i=r.replace(/^(?:all\s+)?(?:the\s+)?/i,"").trim();if(!/^[a-z][a-z'-]*$/i.test(i))return null;let a=yd(e,i);if(!a)return null;s.push(i.toLowerCase()),o.push(a)}return{asked:[...new Set(s)],classes:[...new Set(o)]}}function aA(e,t){let n=String(t||"").trim().toLowerCase();if(!n)return null;let s=new Set;for(let o of e?.individuals||[])o?.id&&(String(o.id).toLowerCase()===n||String(o.label||"").toLowerCase()===n)&&s.add(o.id);return s.size===1?[...s][0]:null}function cA(e,t){let n=ya(String(t||"").trim()),s=n.match(oA),o=s?qm[s[1].toLowerCase()]:"placement";if(!o)return null;let r=s?s[2]:n.match(rA)?.[1]||n.match(iA)?.[1];if(!r)return null;let i={node:"worldRelation",relation:o,predicate:bo[o].predicate},a=sA(e,r);if(a)return{...i,classes:a.classes,asked:a.asked};let c=aA(e,r);return c?{...i,subjects:[c],asked:[c]}:null}function lA(e,t){return bo[e].matchesLocativePredicates?nr(yi(t.prop))||nr(yi(t.predicate)):null}function uA(e,t){let n=t.classes?new Set(t.classes):null,s=t.subjects?new Set(t.subjects):null,o=bo[t.relation],r=yi(o.predicate),i=new Map,a=new Map;for(let l of e?.relations||[]){let u=yi(l.prop),d=yi(l.predicate),p=u===r||d===r,f=p?null:lA(t.relation,l);if(!(!p&&!f))for(let m of l.edges||[]){let h=e.byId?.get(m.subject);if(!h||!(s?s.has(m.subject):n.has(h.class)))continue;let b={subject:h,object:m.object,reads:p?o.reads:`is ${f}`};p?i.set(m.subject,b):a.set(`${u||d}\0${m.subject}`,b)}}let c=[...i.values(),...[...a.values()].filter(l=>!i.has(l.subject.id))].sort((l,u)=>String(l.subject.id).localeCompare(String(u.subject.id))||String(l.object).localeCompare(String(u.object)));return{compositeKind:"worldRelation",relation:t.relation,asked:t.asked,pairs:c,matches:c.map(l=>l.subject)}}function Hu(e){let t=dA.exec(String(e??""));return t?{base:t[1],epoch:t[2]?Number(t[2]):0,stamp:Number(t[3])}:{base:String(e??""),epoch:0,stamp:0}}function pA(e,{classOf:t=()=>null}={}){let n=new Map;for(let a of e||[])a?.predicate==="rdf:type"&&a.subject&&a.object&&n.set(Hu(a.subject).base,String(a.object));let s=new Set(Km),o=new Map,r=new Map;for(let a of e||[]){if(!a?.subject||!s.has(a.predicate))continue;let{base:c,epoch:l,stamp:u}=Hu(a.subject),d=n.get(c)||t(c);if(!d)continue;let p=`${a.predicate}\0${c}`;fA(r.get(p),l,u)&&(o.set(c,{id:c,label:c,class:d}),r.set(p,{epoch:l,stamp:u,predicate:a.predicate,subject:c,object:Hu(a.object).base}))}let i=new Map;for(let a of r.values())i.has(a.predicate)||i.set(a.predicate,{prop:a.predicate,predicate:a.predicate,examples:[]}),i.get(a.predicate).examples.push({subject:a.subject,object:a.object});return{individuals:[...o.values()],objectProperties:[...i.values()]}}function gA(e,t,n){let s=String(t?.object||"").trim();if(!s)return!1;let o=yd(e,s);if(!o)return!1;let r=[n.objMatch,...n.candidates||[]].filter(Boolean),i=new Set(r.map(c=>c.id));if(i.size<2)return!1;let a=new Map;for(let c of e?.individuals||[])c?.id&&(a.has(c.id)||a.set(c.id,new Set),a.get(c.id).add(c.class));return[...i].every(c=>c===o||a.get(c)?.has(o))}function bA(e,t){return t?.class?t.class==="Module"||t.class==="File"?!0:!!Ao(e,t):!1}function wA(e,t){let n=ci(t);if(!n)return null;let s=wn(e,n),o=s?.ambiguous?null:s?.match;return!o||o.class!=="Class"?null:`which classes transitively inherit from ${o.label}`}function $A(e,t){let n=li(String(t||"")).trim();if(ci(n)||Nu(n)!==n)return null;let s=n.match(yA);if(!s)return null;let o=wn(e,s[1].trim()),r=o?.ambiguous?null:o?.match;if(!r||!bA(e,r))return null;let i=r.class==="Class"?"what inherits from it":r.class==="Module"||r.class==="File"?"what imports or calls it":"what calls it";return{content:`I can't answer that \u2014 the index records what is, not what would be. What it can read about ${r.label}: "what would break if ${r.label} were deleted" (${i}), or "/describe ${r.label}" for the facts it holds.`,tmct_ask:{mechanical:!0,parsed:null,canonical:null,matches:[],traversal:null,miss:!0,ambiguous:!1,matchedVia:null,relaxed:null}}}function eo(e,t,{contextId:n=null,nlp:s=void 0,prev:o=null}={}){if(YT(t))return{content:md(),tmct_ask:{mechanical:!0,parsed:null,canonical:null,matches:[],traversal:null,miss:!0,ambiguous:!1,matchedVia:null,help:!0,relaxed:null}};let r=$A(e,t);if(r)return r;t=wA(e,t)||t,t=QT(e,t);let i=od(t,{nlp:s}),a=i.parsed,c=a,l=null;if(Yb(e,a,n)===!1){let f=XT(e,t,{nlp:s,contextId:n,prev:o});f&&(c=f.parsed,l={from:f.from,to:f.to,dropped:f.dropped,steps:f.steps})}let u=on(e,c,{contextId:n,prev:o}),d=zn(c,u,e);if(gb(e,c,u,d)){let f=nA(e,t);if(f){let m=on(e,f,{contextId:n,prev:o}),h=zn(f,m,e);h.miss||(c=f,u=m,d=h,l=null)}}if(gb(e,c,u,d)){let f=cA(e,t);if(f){let m=on(e,f,{contextId:n,prev:o}),h=zn(f,m,e);h.miss||(c=f,u=m,d=h,l=null)}}if(c===null&&d.miss&&!d.ambiguous){let m=li(String(t||"")).trim().match(mA)?.[1]?.trim();if(m&&!/\s+(?:for|about)$/i.test(m)){let h=To(`what is a ${m}`,{nlp:s});h?.shape==="meta"&&(u=on(e,h,{contextId:n,prev:o}),d=zn(h,u,e))}}if(c===null&&d.miss&&!d.ambiguous){let m=jo(String(t||"")).match(hA)?.[1]?.trim();if(m){let h=To(`what is a ${m}`,{nlp:s});if(h?.shape==="meta"){let g=on(e,h,{contextId:n,prev:o}),b=zn(h,g,e);!b.miss&&!b.ambiguous&&(u=g,d=b)}}}let p=l&&!d.miss&&l.to!==l.from?`read as "${l.to}" \u2014 ${d.content}`:d.content;if(!l&&!d.miss&&!d.ambiguous&&i.alternates.length){let f=i.alternates.map(m=>{let h=on(e,m.parsed,{contextId:n,prev:o}),g=zn(m.parsed,h,e);return g.miss?null:{a:m,text:g.content}}).filter(Boolean);if(f.length){let m=Xg(f.map(h=>h.a),{answerFor:h=>f.find(g=>g.a===h)?.text||null});p=`${p}
60
+ ${m.join(`
61
+ `)}`}}if(!d.ambiguous&&u.objMatch&&Array.isArray(u.candidates)&&u.candidates.length){let f=new Set((u.matches||[]).map(h=>h&&h.id)),m=u.candidates.filter(h=>h&&h.id&&h.id!==u.objMatch.id&&!f.has(h.id));if(m.length){let h=m.slice(0,3).map(y=>y.label).filter(Boolean),g=m.length-h.length,b=h.join(", ")+(g>0?`, +${g} more`:"");p=`${p}
62
+ (answering for ${u.objMatch.label} \u2014 ${m.length} other match${m.length===1?"":"es"}: ${b})`}}return!Array.isArray(u.referents)&&!d.miss&&!d.ambiguous&&(c?.shape==="reverse"||c?.shape==="forward")&&c.entityType&&Array.isArray(u.matches)&&u.matches.length&&u.matches.every(f=>f&&f.class===c.entityType)&&(u={...u,referents:vi(c.entityType,u.matches,"relationListing")}),{content:p,tmct_ask:{mechanical:!0,parsed:c&&!c.ambiguousParse?c:null,canonical:Vb(c),matches:(u.matches||[]).map(f=>({id:f.id,label:f.label,type:f.class,module:f.class?Co(f):void 0})),traversal:u.traversal||null,miss:!!d.miss,ambiguous:!!d.ambiguous,relaxed:l,matchedVia:u.matchedVia||null,...Array.isArray(u.referents)&&u.referents.length?{discourse:u.referents}:{},...d.ambiguous?{candidates:d.candidates,candidateParses:d.candidateParses}:{}}}}var tb,wr,Js,Wu,p_,At,bb,rt,qu,m_,h_,g_,b_,w_,$_,wb,yb,Ku,x_,Zs,rd,ut,$b,S_,k_,__,A_,C_,O_,N_,L_,P_,F_,D_,cd,z_,U_,W_,kb,ud,Rb,_b,Q_,tT,nb,sb,rT,Ob,ob,aT,rb,dT,ab,lb,mT,gT,wT,js,Gu,OT,NT,LT,gd,PT,fb,MT,pb,UT,Ja,sd,wd,qb,HT,qT,KT,hb,JT,eA,tA,$d,oA,rA,iA,yi,dA,fA,mA,hA,gb,yA,Jn=M(()=>{De();wu();Kn();kn();pr();Ua();Ba();eb();zu();qs();mi();Bu();gr();tb=new WeakMap;wr={calls:"callsSymbol",touches:"touchesSymbol"},Js=new Set(["Function","Method","Class","Attribute","GlobalVariable"]),Wu={Function:"Method",Method:"Function"},p_={uses:["imports","calls","callsSymbol"]},At=e=>p_[e]||[e],bb=new Set(Object.values(wr)),rt=12,qu={Function:["function","functions"],Method:["method","methods"],Class:["class","classes"],Module:["module","modules"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"],Change:["change","changes"],Package:["package","packages"],Fact:["fact","facts"],Utterance:["utterance","utterances"],Session:["session","sessions"],Source:["source","sources"],Rule:["rule","rules"]};m_={cochange:"cochanges",reexports:"export"};h_={imports:"import",calls:"call",callsSymbol:"call",inherits:"inherit from",contains:"contain",tests:"test",touches:"touch",cochange:"cochange",reexports:"export",uses:"use",serves:"serve",denotes:"denote"},g_=e=>h_[e]||Qs(e),b_=new RegExp(`^(?:${Object.keys(me).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})(?:s|ing|ed)?\\s+`,"i"),w_=new Set(["imports"]);$_=/^where\s+(?:does|do|did)\s+/i,wb=new Set(ge(fn));yb=4,Ku="zzinnerset",x_=new Set(["that","which","who","are","is","was","were","do","does","also","still","both","and","then","though"]),Zs=new Set(["which","what","who","list","show","find","give","me","us","all"]),rd=new Set(["are","is","was","were"]);ut=e=>Ze[e]?{entityType:Ze[e],placeholder:!1}:bs.includes(e)?{entityType:null,placeholder:!0}:null,$b=e=>!!me[e]&&e.endsWith("ing");S_=new Set(["which","the","all"]);k_=new Set(["all","every","each"]);__=new Set(["what","which","thing","things","one","ones","stuff"]);A_=new Set(["defined","declared"]);C_=new Set(["those","them"]);O_=new Set(["did","was","were","do","does","has","have","had"]),N_=new Set(["change","changed","changes","update","updated","updates","modify","modified","modifies","touch","touched","touches","edit","edited","revise","revised"]),L_=new Set(["last","recently","ever","get","got","been","then","now","already"]),P_=new Set(["the","a","an","all","those","these","any"]);F_=new Set(["since","before","after","on"]),D_=new Set(["what","which"]);cd=new Set(["the","a","an","all","those","these","any"]);z_=new Set(["is","are","was","were","does","do","did"]),U_=new Set(["the","a","an","all","those","these","any"]);W_=/\b[\w-]+(?:[/.][\w-]+)+\b|\b[A-Z][A-Za-z0-9_]*\b|\b[a-z][a-z0-9]*[A-Z][A-Za-z0-9]*\b/;kb=new Set(["total","altogether","overall","exist","exists","existing","present","here","now","currently","graph","index","codebase","repo","repository","this","that"]);ud=new Set(["the","a","an","all","me","us"]),Rb=[...vo].sort((e,t)=>t.split(" ").length-e.split(" ").length),_b="functions, classes, methods, modules, packages, attributes, variables, or commits",Q_=new Set(["in","inside","under"]);tT=new Set(["called","named","about","like","containing","matching","with"]);nb=new Set(["recent","latest","newest"]);sb=new WeakMap;rT=new Set(["defines","contains"]),Ob=(e,t)=>t==="Module"&&At(e).some(n=>rT.has(n)),ob=new WeakMap;aT=/^git:(.+)$/i;rb=new WeakMap;dT=new Set(["Class","Function","Method","GlobalVariable","Attribute"]);ab=new WeakMap;lb={label:3,chain:2,attr:1};mT=e=>e&&typeof e.value=="boolean"?{...e,value:!e.value}:null;gT=["imports","calls","callsSymbol","inherits","contains","tests"];wT=/^\d{4}-\d{2}-\d{2}$/;js=e=>gn(e.slice(0,rt).map(t=>["Function","Method"].includes(t.class)?`${t.label}()`:t.label))+(e.length>rt?`, \u2026and ${e.length-rt} more`:"");Gu=10;OT=/^(?:the|a|an)\s+/i,NT=new RegExp(`\\s+(${Object.keys(Ze).join("|")})$`,"i");LT=/^(?:the\s+)?(?:main\s+|primary\s+)?entry[\s-]?points?(?:\s+(?:of|to|for)\s+(?:this|the)\s+(?:codebase|code|repo|repository|project|app))?$/i,gd=new Set(["index","main","app","server","cli","__main__"]),PT=new Set(["test","tests","__tests__","fixture","fixtures","spec","specs","testdata"]),fb=e=>String(e).toLowerCase().split("/").pop().replace(/\.[a-z0-9]+$/,""),MT=e=>String(e).toLowerCase().split("/").slice(0,-1).some(t=>PT.has(t));pb=8;UT=new Set(["mgx:schemaDoc","mgx:lexiconDoc"]);Ja=new Set([...ge(Object.keys(me)),...ge(Object.keys(Ze)),...ge(Object.keys(mn)),...ge(Object.keys(ct)),...ge($o),...ge(Object.keys(Hn)),...ge(Object.keys(qn)),...ge(Object.keys(sr)),...ge(bs),...ge(ei),...ge(yo),...ge(fn),...ge(Mn),...ge(En),...ge(Object.keys(rr)),...ge([...$a])]),sd=new Set([...dt,...Zs,...wo]),wd=new Set(ge(xa)),qb=new Set([...wd,...sd]),HT=["many","count","number","quantity","total","tally","list","show","display","print","dump","enumerate","name"],qT=[...new Set([...ge(Object.keys(me)),...Object.keys(Ze),...HT])].filter(e=>/^[a-z]+$/.test(e)&&e.length>=4&&!dt.has(e)),KT=new Set(["impact","impacts","impacted"]);hb=/\b(?:the\s+)?(?:last|latest|most\s+recent)\s+commit\b/i,JT=/^when\s+(?:was|were|is|did|does|do)\s+commit\s+[0-9a-fA-F:]+$/i;eA=/^(?:list|show(?:\s+me)?)\s+(?:all\s+|the\s+)?([a-z][a-z'-]*)\s*(.*)$/i,tA=/^(?:how\s+many|number\s+of|count(?:\s+the)?)\s+([a-z][a-z'-]*)\s*(.*)$/i,$d=/^(?:are there(?:\s+in\s+total)?|is there|do you know(?:\s+about)?|do you have|exist(?:s)?|are known|in (?:the |a )?(?:graph|memory)|you know(?:\s+about)?)?[?.!\s]*$/i;oA=new RegExp(`^(?:${Rb.map(ot).join("|")})\\s+(?:all\\s+)?(?:the\\s+)?([a-z][a-z'-]*)\\s+(?:of|for)\\s+(.+?)[?.!\\s]*$`,"i"),rA=/^where(?:'s|\s+is|\s+are)\s+(?:all\s+)?(?:the\s+)?(.+?)[?.!\s]*$/i,iA=/^where\s+(?:does|do|did)\s+(?:all\s+)?(?:the\s+)?(.+?)\s+[a-z][a-z'-]*[?.!\s]*$/i;yi=e=>String(e||"").toLowerCase();dA=/^(.+?)@(?:epoch(\d+)@)?(?:turn|step)(\d+)$/;fA=(e,t,n)=>!e||e.epoch<t||e.epoch===t&&e.stamp<=n;mA=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,hA=/^what\s+is\s+(?:the\s+)?(?!(?:an?|it|this|that|these|those)\s)(.+?)\s+(?:used\s+)?for[?.!\s]*$/i;gb=(e,t,n,s)=>s.ambiguous?gA(e,t,n):!!s.miss;yA=new RegExp("^if\\s+(.+?)\\s+(?:were|was|had|has|is|are|becomes?|became|gets?|got|stops?|stopped|starts?|started)\\s+[^,]*,?\\s*(?:would|will|could|might|should)\\b","i")});function to(e,t,n,s){let o=Math.max(1,t),r=Math.min(e.length,n),i=!1;s!=null&&r-o+1>s&&(r=o+s-1,i=!0);let a=e.slice(o-1,r).map((c,l)=>`${o+l} ${c}`).join(`
63
+ `);return{start:o,end:r,text:a,truncated:i}}async function Ts({readFile:e,repoRoot:t,path:n,start:s,end:o,maxLines:r}){let i=Gt(t),a=Gt(i,n);if(a!==i&&!a.startsWith(i+Bm))throw new Ne(`refusing to read outside the repository root: ${n}`);let l=(await e(a,"utf8")).split(`
64
+ `);return s==null||o==null?{lines:l}:{lines:l,...to(l,s,o,r)}}var ec=M(()=>{Je();Kt()});function Ct(e){return{ok:!0,value:e}}function It(e,{detail:t="",term:n=null}={}){if(!ht[e])throw new TypeError(`miss(): unknown reason "${e}" (not in MISS_REASONS)`);return{ok:!1,miss:{reason:e,detail:t,term:n}}}function Qn(e){return!e||!e.id?null:{id:String(e.id),label:e.label!=null?String(e.label):String(e.id),class:e.class||"Entity",attributes:(Array.isArray(e.attributes)?e.attributes:[]).map(t=>({key:t.key,value:t.value,prop:t.prop||null}))}}function tc(e,{predicate:t="",prop:n=null}={}){let s={subject:e.subject,object:e.object,predicate:t,prop:n||null};return e.subjectLabel!=null&&(s.subjectLabel=e.subjectLabel),e.objectLabel!=null&&(s.objectLabel=e.objectLabel),e.weight!=null&&(s.weight=e.weight),s}var xd,vA,ht,Ed,zz,Jb,Sd,xA,Un,vd,Ht,Uz,Qb=M(()=>{xd="1.1.0",vA="urn:tmct:core",ht=Object.freeze({UNRESOLVED_TERM:"UNRESOLVED_TERM",CAPABILITY_ABSENT:"CAPABILITY_ABSENT",TRUNCATED_GRAPH:"TRUNCATED_GRAPH",NO_SOURCE:"NO_SOURCE"}),Ed=Object.freeze(["imports","calls","callsSymbol","defines","tests","touches","touchesSymbol","contains","inherits","cochange","reexports","serves","denotes"]),zz=Object.freeze({imports:"tmct:imports",calls:"tmct:calls",callsSymbol:"tmct:calls",defines:"tmct:defines",tests:"tmct:covers",touches:"tmct:touches",touchesSymbol:"tmct:touches",contains:"tmct:contains",inherits:"tmct:extends",cochange:"tmct:dependsOn",reexports:"tmct:exports",serves:"tmct:serves",denotes:"tmct:denotes"}),Jb=Object.freeze({resolution:["resolve","describe","members","subclasses","exports","signature"],traversal:["edges","impact"],source:["snippet","context"],aggregate:["architecture","untested","stats"],temporal:["history"],search:["search","ask"]}),Sd=Object.freeze(Object.values(Jb).flat()),xA=Object.freeze(new Set(Jb.source));Un="Individual",vd="Edge",Ht="concurrent-safe: reads immutable graph truth; no shared mutable state",Uz=Object.freeze({version:xd,ontology:vA,missReasons:Object.values(ht),edgeKinds:[...Ed],types:{Individual:{fields:{id:"string (opaque provider id)",label:"string (human/display name)",class:"string \u2014 a tmct: class token (module|class|function|method|attribute|variable|commit|test|\u2026)",attributes:"Array<{ key: string, value: string, prop: string|null }> \u2014 prop is the SEON/mgx token grounding the value"}},Edge:{fields:{subject:"string (individual id)",object:"string (individual id)",predicate:"string \u2014 the relation predicate",prop:"string|null \u2014 the SEON/mgx property token; see edgeKinds \u2192 tmct: mapping",subjectLabel:"string? (additive)",objectLabel:"string? (additive)",weight:"number? (additive; e.g. cochange coupling)"}},Result:{shape:"{ ok: true, value: T } | { ok: false, miss: Miss }"},Miss:{shape:"{ reason: MISS_REASONS, detail: string, term: string|null }"}},capabilitiesModel:"A provider advertises `capabilities: string[]` (service names it implements). A service outside the set is negotiated away to miss(CAPABILITY_ABSENT) \u2014 never an error. snippet may be advertised yet answer miss(NO_SOURCE) when no working tree exists (it has nothing useful without fs); context is graph-only-capable since INTERFACE_VERSION 1.1.0 \u2014 it returns a real hit (graph-only bundle) for any resolvable symbol even with no working tree, only escalating NO_SOURCE-style behavior to richer body text when source-capable.",services:{resolve:{group:"resolution",args:{term:"string"},result:`{ match: ${Un}, candidates: ${Un}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"The resolveSymbol seam: map a free term to an individual + runner-up candidates. Every id-taking service consumes a resolved id."},describe:{group:"resolution",args:{id:"string"},result:`{ individual: ${Un}, out: ${vd}[], incoming: ${vd}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"Full typed portrait of one individual: its attributes and its outgoing/incoming edges."},members:{group:"resolution",args:{classId:"string"},result:`{ methods: ${Un}[], attributes: ${Un}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"A class's methods + attributes (via the contains relation) \u2014 replaces reading the class body."},subclasses:{group:"resolution",args:{classId:"string"},result:`{ bases: ${Un}[], subclasses: ${Un}[], levels: Array<${Un}[]> }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"Forward bases + the transitive reverse inheritance closure (who extends this). `subclasses` is the flat closure; `levels` groups the same individuals by inheritance depth (direct children first), mirroring `impact`'s leveled shape."},exports:{group:"resolution",args:{moduleId:"string"},result:`{ exports: ${Un}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"A module's curated public API (resolved __all__ / re-exports)."},signature:{group:"resolution",args:{id:"string"},result:"{ id, label, class, params, returns, raises, decorators, doc, selfFields, flags }",misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"The compact API surface of a symbol without its body."},edges:{group:"traversal",args:{id:"string",kind:"EDGE_KINDS member"},result:`{ kind: string, edges: ${vd}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"Outgoing edges of one closed kind from an individual (an honest empty array is not a miss).",note:"An unknown kind (outside EDGE_KINDS) is a programming error and throws TypeError, not a miss."},impact:{group:"traversal",args:{moduleId:"string"},result:"{ total: number, levels: Array<Array<{ id, label, via, tests }>> }",misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"The transitive dependent closure the interpreter cannot compute without provider truth."},snippet:{group:"source",args:{id:"string"},result:"{ path: string, span: { start, end }, body: string|null } \u2014 Promise<Result>",misses:["UNRESOLVED_TERM","NO_SOURCE"],concurrency:Ht,purpose:"The exact source span of a symbol. A provider with no working tree returns miss(NO_SOURCE) honestly \u2014 snippet has nothing useful without fs.",note:"ASYNC (returns Promise<Result>) \u2014 a real body read is inherently fs I/O; callers should always await it. A graph-only provider still resolves synchronously-in-spirit (the promise settles on the same tick) but the return type is uniformly a Promise regardless of sourceAccess."},context:{group:"source",args:{symbol:"string",depth:"min|auto|full?"},result:"{ text: string, tier: string } (a sized edit bundle) \u2014 Promise<Result>",misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"The composed edit bundle (exemplar, siblings, registration, insertion region). A graph-only provider returns the graph-only sections as a real hit; a source-capable provider (sourceAccess:true, repoRoot, readFile) additionally includes the anchor/exemplar/inlined-callee body text.",note:"ASYNC (returns Promise<Result>) \u2014 see snippet's note; source-capable rendering is fs I/O."},architecture:{group:"aggregate",args:{package:"string?"},result:"{ modules: number, packages: Array<[dir, count]>, hubs: Array<{ id, label, importers }> }",misses:[],concurrency:Ht,purpose:"Package/module shape + the most-imported hub modules. Optional package prefix scopes it."},untested:{group:"aggregate",args:{},result:`{ modules: ${Un}[] }`,misses:[],concurrency:Ht,purpose:"Modules with no covering test module (via the tests relation)."},stats:{group:"aggregate",args:{},result:"{ total: number, classes: Array<{ class: string, count: number }>, truncated: boolean }",misses:[],concurrency:Ht,purpose:"Per-tmct:class individual counts, read straight from the payload."},history:{group:"temporal",args:{id:"string"},result:"{ commits: Array<{ id, label, author, date, message }> }",misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"The commits that touched an individual (tmct:commit individuals via tmct:touches)."},search:{group:"search",args:{query:"string",kind:"string?",name:"string?",decorator:"string?"},result:`{ results: ${Un}[] }`,misses:[],concurrency:Ht,purpose:"Lexical, provider-local locate. An empty result set is honest, not a miss."},ask:{group:"search",args:{query:"string"},result:"{ content: string, tmct_ask: object } (the composed NL round-trip envelope)",misses:[],concurrency:Ht,purpose:"The mechanical, zero-model NL query over the graph \u2014 tmct's whole reason to exist."}}})});function EA(e,t){let n=[],s=[];for(let o of e.relations)for(let r of o.edges)r.subject===t&&n.push(tc(r,{predicate:o.predicate,prop:o.prop})),r.object===t&&s.push(tc(r,{predicate:o.predicate,prop:o.prop}));return{out:n,incoming:s}}function SA(e,t){for(let n of e.relations)if(xs(n)===t)return{predicate:n.predicate,prop:n.prop};return{predicate:t,prop:null}}async function kA(e,t,{readFile:n,repoRoot:s}){if(!e.moduleLabel)return"";let o=null;try{({lines:o}=await Ts({readFile:n,repoRoot:s,path:e.moduleLabel}))}catch{o=null}if(!o)return"";let r=[];if(t.anchor&&e.anchor?.site){let{start:i,end:a}=e.anchor.site;r.push(`
65
+ ## anchor: ${e.anchor.label} (${e.anchor.class}) @ ${e.moduleLabel}:${i}-${a}`),r.push(to(o,i,a,jd).text),e.callHint&&r.push(e.callHint)}if(t.exemplar&&e.exemplar?.site){let{start:i,end:a}=e.exemplar.site,c=e.exemplar.decorators?` @${e.exemplar.decorators}`:"";r.push(`
66
+ ## closest example (full body) \u2014 copy this style: ${e.exemplar.label} (${e.exemplar.class})${c} @ ${e.moduleLabel}:${i}-${a}`),r.push(to(o,i,a,jd).text),e.callHint&&r.push(e.callHint)}if(t.inlinedCallees&&e.calleeBodies.length){let i=jA;for(let a of e.calleeBodies){if(i<=0)break;let c=a.site.start,u=a.site.path===e.moduleLabel?o:null;if(!u)try{({lines:u}=await Ts({readFile:n,repoRoot:s,path:a.site.path}))}catch{u=null}if(!u)continue;let d=to(u,c,a.site.end,i);r.push(`
67
67
  ## inlined callee body (depth-1 in-repo call): ${a.label} @ ${a.site.path}:${c}-${a.site.end}`),r.push(d.text),i-=d.end-c+1}}return r.join(`
68
- `)}function ec(e,{sourceAccess:t=!1,repoRoot:n=null,readFile:s=null,tel:o=null,ask:r=null}={}){let i=e.byId;if(t&&(!n||typeof s!="function"))throw new TypeError("createGraphService({ sourceAccess: true }) requires both repoRoot and readFile \u2014 fs access is an injected capability, not an ambient import.");let a=l=>i.get(l)||null,c={version:yd,capabilities:[...vd],sourceAccess:!!t,graph:e,resolve(l){let{match:u,candidates:d}=hn(e,String(l??""));return u?At({match:Qn(u),candidates:d.map(Qn)}):Ct(ht.UNRESOLVED_TERM,{term:String(l??"")})},describe(l){let u=a(l);if(!u)return Ct(ht.UNRESOLVED_TERM,{term:l});let{out:d,incoming:p}=fA(e,l);return At({individual:Qn(u),out:d,incoming:p})},members(l){if(!a(l))return Ct(ht.UNRESOLVED_TERM,{term:l});let d=_e(e,"contains").filter(m=>m.subject===l),p=[],f=[];for(let m of d){let h=i.get(m.object),g=h?Qn(h):{id:m.object,label:m.objectLabel||m.object,class:"Entity",attributes:[]};(h?.class||"")==="Attribute"?f.push(g):p.push(g)}return At({methods:p,attributes:f})},subclasses(l){if(!a(l))return Ct(ht.UNRESOLVED_TERM,{term:l});let d=_e(e,"inherits"),p=d.filter(y=>y.subject===l).map(y=>i.get(y.object)?Qn(i.get(y.object)):{id:y.object,label:y.objectLabel||y.object,class:"Class",attributes:[]}),f=new Map;for(let y of d)f.has(y.object)||f.set(y.object,[]),f.get(y.object).push(y.subject);let m=new Set([l]),h=[],g=[],b=[l];for(let y=0;y<8&&b.length;y+=1){let $=[],E=[];for(let _ of b)for(let v of f.get(_)||[]){if(m.has(v))continue;m.add(v);let S=i.get(v),C=S?Qn(S):{id:v,label:v,class:"Class",attributes:[]};h.push(C),E.push(C),$.push(v)}E.length&&g.push(E),b=$}return At({bases:p,subclasses:h,levels:g})},exports(l){if(!a(l))return Ct(ht.UNRESOLVED_TERM,{term:l});let p=_e(e,"reexports").filter(f=>f.subject===l).map(f=>i.get(f.object)?Qn(i.get(f.object)):{id:f.object,label:f.objectLabel||f.object,class:"Entity",attributes:[]});return At({exports:p})},signature(l){let u=a(l);if(!u)return Ct(ht.UNRESOLVED_TERM,{term:l});let d=[];for(let[f,m]of[["isStatic","static"],["isAbstract","abstract"],["isConstant","constant"]])rn(u,f)&&d.push(m);let p=rn(u,"visibility");return p&&d.push(p),At({id:u.id,label:u.label,class:u.class||"Entity",params:rn(u,"params"),returns:rn(u,"returns"),raises:rn(u,"raises"),decorators:rn(u,"decorators"),doc:rn(u,"doc"),selfFields:rn(u,"self_fields"),flags:d})},edges(l,u,{limit:d,offset:p=0}={}){if(!$d.includes(u))throw new TypeError(`edges(): unknown kind "${u}" (not in EDGE_KINDS)`);if(!a(l))return Ct(ht.UNRESOLVED_TERM,{term:l});let m=pA(e,u),h=_e(e,u).filter(g=>g.subject===l).map(g=>Za(g,m));return h=d==null?h.slice(p):h.slice(p,p+d),At({kind:u,edges:h})},impact(l,{maxDepth:u}={}){let d=a(l);if(!d)return Ct(ht.UNRESOLVED_TERM,{term:l});let p=u==null?ur(e,d):ur(e,d,{maxDepth:u}),f=p.reduce((m,h)=>m+h.length,0);return At({total:f,levels:p})},async snippet(l){let u=a(l);if(!u)return Ct(ht.UNRESOLVED_TERM,{term:l});let d=Vt(u);if(!c.sourceAccess)return Ct(ht.NO_SOURCE,{term:l,detail:d?`span is ${d.path}:${d.start}-${d.end}; this provider exposes no working tree`:"no source span in the graph"});if(!d)return Ct(ht.NO_SOURCE,{term:l,detail:"no source span in the graph (likely a module)"});try{let p=await Ts({readFile:s,repoRoot:n,path:d.path,start:d.start,end:d.end,maxLines:xd});return At({path:d.path,span:{start:d.start,end:d.end},body:p.text})}catch(p){return Ct(ht.NO_SOURCE,{term:l,detail:`could not read ${d.path}: ${p?.message||p}`})}},async context(l,{depth:u="auto"}={}){let{match:d}=hn(e,String(l??""));if(!d)return Ct(ht.UNRESOLVED_TERM,{term:String(l??"")});let p=dr(e,d),f=String(u||"auto").trim().toLowerCase(),m,h;f==="min"?(m="TINY",h=Eo("TINY")):f==="full"?(m="FULL",h=Eo("FULL")):{tier:m,mask:h}=Na(p,e,{});let g=hg(p,h);if(!c.sourceAccess)return At({text:g,tier:m});let b=await hA(p,h,{readFile:s,repoRoot:n});return At({text:b?`${g}
69
- ${b}`:g,tier:m})},architecture({package:l=""}={}){let u=String(l||"").trim().toLowerCase().replace(/^\.?\//,""),d=e.individuals.filter(b=>(b.class||"")==="Module"&&(!u||String(b.label||"").toLowerCase().startsWith(u))),p=new Map;for(let b of d){let y=b.label.includes("/")?b.label.slice(0,b.label.lastIndexOf("/")):"(root)";p.set(y,(p.get(y)||0)+1)}let f=new Set(d.map(b=>b.id)),m=new Map;for(let b of _e(e,"imports"))f.has(b.object)&&m.set(b.object,(m.get(b.object)||0)+1);let h=[...m.entries()].sort((b,y)=>y[1]-b[1]).map(([b,y])=>({id:b,label:i.get(b)?.label||b,importers:y})),g=[...p.entries()].sort((b,y)=>y[1]-b[1]);return At({modules:d.length,packages:g,hubs:h})},untested(){let l=new Set(_e(e,"tests").map(d=>d.object)),u=e.individuals.filter(d=>(d.class||"")==="Module"&&!l.has(d.id)&&!/\.test\./.test(d.label||"")).map(Qn);return At({modules:u})},stats(){let l=new Map;for(let d of e.individuals){let p=d.class||"Entity";l.set(p,(l.get(p)||0)+1)}let u=[...l.entries()].map(([d,p])=>({class:d,count:p})).sort((d,p)=>p.count-d.count||d.class.localeCompare(p.class));return At({total:e.individuals.length,classes:u,truncated:(e.truncated||[]).length>0})},history(l){if(!a(l))return Ct(ht.UNRESOLVED_TERM,{term:l});let d=[..._e(e,"touches"),..._e(e,"touchesSymbol")].filter(m=>m.object===l),p=new Set,f=[];for(let m of d){if(p.has(m.subject))continue;p.add(m.subject);let h=i.get(m.subject);f.push({id:m.subject,label:m.subjectLabel||h?.label||m.subject,author:h?rn(h,"author")??rn(h,"commitAuthor"):null,date:h?rn(h,"date")??rn(h,"commitDate"):null,message:h?rn(h,"message")??rn(h,"commitMessage"):null})}return At({commits:f})},search(l,{kind:u="",name:d="",decorator:p="",limit:f=Aa,offset:m=0}={}){let h=String(l||""),g=String(u||"").trim().toLowerCase(),b=String(d||"").trim(),y=String(p||"").trim().toLowerCase(),$;if(g&&g!=="module"){let _=null;if(b){let S=ku(b);if(S.error)return Ct(ht.UNRESOLVED_TERM,{term:b,detail:S.error});_=S}let v=h.toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean);try{$=Tu(e,v,{kind:g,decFilter:y,nameRe:_}).map(S=>S.ind)}catch(S){return Ct(ht.UNRESOLVED_TERM,{term:b,detail:String(S?.message||S)})}}else{let _=new Map;for(let v of e.individuals)(v.class||"")==="Module"&&_.set(v.label,v);$=Hh(e,h).map(({path:v})=>_.get(v)).filter(Boolean)}let E=$.slice(m,m+f).map(Qn);return At({results:E})},ask(l){if(typeof r!="function")return Ct(ht.CAPABILITY_ABSENT,"this provider was constructed without an ask answerer");let{content:u,tmct_ask:d}=r(e,String(l||""));return At({content:u,tmct_ask:d})}};if(o)for(let l of vd){let u=c[l];typeof u=="function"&&(c[l]=(...d)=>{let p=performance.now(),f=u.apply(c,d);return f&&typeof f.then=="function"?f.then(m=>(Yb(o,l,performance.now()-p,m),m)):(Yb(o,l,performance.now()-p,f),f)})}return c}function Yb(e,t,n,s){try{e.record({tool:`ri.${t}`,perf:{ms_total:n},response:gA(s)})}catch{}}function gA(e){if(!e||typeof e!="object"||e.ok!==!0)return{ok:!1,reason:e?.miss?.reason||null};let t=0,n=e.value;if(Array.isArray(n))t=n.length;else if(n&&typeof n=="object")for(let s of Object.values(n))Array.isArray(s)&&(t+=s.length);return{ok:!0,count:t}}var rn,xd,mA,tc=M(()=>{De();Qa();Kb();rn=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value??null;xd=200,mA=120});async function yi(e,t){let n=await t.fetchEntities(e),s=Ta(n);if(!s.individuals.length){let o=new Oe(`the graph at ${e.graphFile} is empty \u2014 no entities to answer from yet (this repo starts with no graph; the chat session folds the conversation into one).`);throw o.emptyGraph=!0,o}return s}var nc=M(()=>{Kt();De()});function to({content:e,data:t,text:n=null}){return{content:e,data:t,text:n??e}}function ft(e,t){let n=String(e?.[t]||"").trim();if(!n)throw new Oe(`${t} is required`);return n}function Ft(e,t,n){let{match:s,candidates:o}=hn(e.graph,t);if(!s)throw new Oe(`no entity matching ${n} "${t}" in the code-map graph. Try a repo-relative path (e.g. path/to/module), a basename, or tmct_search for a fuzzy lookup.`);return{match:s,candidates:o}}var $i,gt,tt=M(()=>{Kt();De();$i=200;gt=e=>(t,{graph:n,svc:s,config:o})=>{let{match:r}=Ft(s,ft(t,"symbol"),"symbol");return e(n,r,{toolNamePrefix:o?.toolNamePrefix})}});async function Xb(e,{config:t,source:n=ir,trim:s=!1,tel:o=null}={}){let r=String(e?.symbol||"").trim();if(!r)throw new Oe("symbol is required");let i=String(e?.depth||"auto").trim().toLowerCase(),a=!!e?.min,c=!!e?.untuned,l=!!e?.max,u=t?.toolNamePrefix||"tmct_",d=await yi(t,n),p=ye(ye(t.graphFile)),f=ec(d,{sourceAccess:!0,repoRoot:p,readFile:Ce,tel:o,ask:Zs}),{match:m}=Ft(f,r,"symbol"),h=dr(d,m),g,b,y=!1;a||i==="min"?(g="TINY",b=Eo("TINY")):l||i==="full"?(g="FULL",b=Eo("FULL"),y=!0):{tier:g,mask:b,topup:y}=Na(h,d,{untuned:c}),s&&!l&&(b=pg(b));let $=null;if(h.moduleLabel)try{({lines:$}=await Ts({readFile:Ce,repoRoot:p,path:h.moduleLabel}))}catch{$=null}let E=S=>$&&$[S-1]!=null?$[S-1].trim():"",_=(S,C)=>eo($,S,C,$i).text,v=[`Edit context for ${h.moduleLabel} [${g}${s?" secondary":""}] \u2014 assembled from the typed graph + that file. You do NOT need to Read it; write the new code directly after reviewing this.`];if(b.anchor&&h.anchor?.site&&$){let{start:S,end:C}=h.anchor.site;v.push(`
68
+ `)}function nc(e,{sourceAccess:t=!1,repoRoot:n=null,readFile:s=null,tel:o=null,ask:r=null}={}){let i=e.byId;if(t&&(!n||typeof s!="function"))throw new TypeError("createGraphService({ sourceAccess: true }) requires both repoRoot and readFile \u2014 fs access is an injected capability, not an ambient import.");let a=l=>i.get(l)||null,c={version:xd,capabilities:[...Sd],sourceAccess:!!t,graph:e,resolve(l){let{match:u,candidates:d}=hn(e,String(l??""));return u?Ct({match:Qn(u),candidates:d.map(Qn)}):It(ht.UNRESOLVED_TERM,{term:String(l??"")})},describe(l){let u=a(l);if(!u)return It(ht.UNRESOLVED_TERM,{term:l});let{out:d,incoming:p}=EA(e,l);return Ct({individual:Qn(u),out:d,incoming:p})},members(l){if(!a(l))return It(ht.UNRESOLVED_TERM,{term:l});let d=_e(e,"contains").filter(m=>m.subject===l),p=[],f=[];for(let m of d){let h=i.get(m.object),g=h?Qn(h):{id:m.object,label:m.objectLabel||m.object,class:"Entity",attributes:[]};(h?.class||"")==="Attribute"?f.push(g):p.push(g)}return Ct({methods:p,attributes:f})},subclasses(l){if(!a(l))return It(ht.UNRESOLVED_TERM,{term:l});let d=_e(e,"inherits"),p=d.filter(y=>y.subject===l).map(y=>i.get(y.object)?Qn(i.get(y.object)):{id:y.object,label:y.objectLabel||y.object,class:"Class",attributes:[]}),f=new Map;for(let y of d)f.has(y.object)||f.set(y.object,[]),f.get(y.object).push(y.subject);let m=new Set([l]),h=[],g=[],b=[l];for(let y=0;y<8&&b.length;y+=1){let $=[],E=[];for(let _ of b)for(let v of f.get(_)||[]){if(m.has(v))continue;m.add(v);let S=i.get(v),C=S?Qn(S):{id:v,label:v,class:"Class",attributes:[]};h.push(C),E.push(C),$.push(v)}E.length&&g.push(E),b=$}return Ct({bases:p,subclasses:h,levels:g})},exports(l){if(!a(l))return It(ht.UNRESOLVED_TERM,{term:l});let p=_e(e,"reexports").filter(f=>f.subject===l).map(f=>i.get(f.object)?Qn(i.get(f.object)):{id:f.object,label:f.objectLabel||f.object,class:"Entity",attributes:[]});return Ct({exports:p})},signature(l){let u=a(l);if(!u)return It(ht.UNRESOLVED_TERM,{term:l});let d=[];for(let[f,m]of[["isStatic","static"],["isAbstract","abstract"],["isConstant","constant"]])rn(u,f)&&d.push(m);let p=rn(u,"visibility");return p&&d.push(p),Ct({id:u.id,label:u.label,class:u.class||"Entity",params:rn(u,"params"),returns:rn(u,"returns"),raises:rn(u,"raises"),decorators:rn(u,"decorators"),doc:rn(u,"doc"),selfFields:rn(u,"self_fields"),flags:d})},edges(l,u,{limit:d,offset:p=0}={}){if(!Ed.includes(u))throw new TypeError(`edges(): unknown kind "${u}" (not in EDGE_KINDS)`);if(!a(l))return It(ht.UNRESOLVED_TERM,{term:l});let m=SA(e,u),h=_e(e,u).filter(g=>g.subject===l).map(g=>tc(g,m));return h=d==null?h.slice(p):h.slice(p,p+d),Ct({kind:u,edges:h})},impact(l,{maxDepth:u}={}){let d=a(l);if(!d)return It(ht.UNRESOLVED_TERM,{term:l});let p=u==null?dr(e,d):dr(e,d,{maxDepth:u}),f=p.reduce((m,h)=>m+h.length,0);return Ct({total:f,levels:p})},async snippet(l){let u=a(l);if(!u)return It(ht.UNRESOLVED_TERM,{term:l});let d=Vt(u);if(!c.sourceAccess)return It(ht.NO_SOURCE,{term:l,detail:d?`span is ${d.path}:${d.start}-${d.end}; this provider exposes no working tree`:"no source span in the graph"});if(!d)return It(ht.NO_SOURCE,{term:l,detail:"no source span in the graph (likely a module)"});try{let p=await Ts({readFile:s,repoRoot:n,path:d.path,start:d.start,end:d.end,maxLines:jd});return Ct({path:d.path,span:{start:d.start,end:d.end},body:p.text})}catch(p){return It(ht.NO_SOURCE,{term:l,detail:`could not read ${d.path}: ${p?.message||p}`})}},async context(l,{depth:u="auto"}={}){let{match:d}=hn(e,String(l??""));if(!d)return It(ht.UNRESOLVED_TERM,{term:String(l??"")});let p=fr(e,d),f=String(u||"auto").trim().toLowerCase(),m,h;f==="min"?(m="TINY",h=So("TINY")):f==="full"?(m="FULL",h=So("FULL")):{tier:m,mask:h}=Ma(p,e,{});let g=wg(p,h);if(!c.sourceAccess)return Ct({text:g,tier:m});let b=await kA(p,h,{readFile:s,repoRoot:n});return Ct({text:b?`${g}
69
+ ${b}`:g,tier:m})},architecture({package:l=""}={}){let u=String(l||"").trim().toLowerCase().replace(/^\.?\//,""),d=e.individuals.filter(b=>(b.class||"")==="Module"&&(!u||String(b.label||"").toLowerCase().startsWith(u))),p=new Map;for(let b of d){let y=b.label.includes("/")?b.label.slice(0,b.label.lastIndexOf("/")):"(root)";p.set(y,(p.get(y)||0)+1)}let f=new Set(d.map(b=>b.id)),m=new Map;for(let b of _e(e,"imports"))f.has(b.object)&&m.set(b.object,(m.get(b.object)||0)+1);let h=[...m.entries()].sort((b,y)=>y[1]-b[1]).map(([b,y])=>({id:b,label:i.get(b)?.label||b,importers:y})),g=[...p.entries()].sort((b,y)=>y[1]-b[1]);return Ct({modules:d.length,packages:g,hubs:h})},untested(){let l=new Set(_e(e,"tests").map(d=>d.object)),u=e.individuals.filter(d=>(d.class||"")==="Module"&&!l.has(d.id)&&!/\.test\./.test(d.label||"")).map(Qn);return Ct({modules:u})},stats(){let l=new Map;for(let d of e.individuals){let p=d.class||"Entity";l.set(p,(l.get(p)||0)+1)}let u=[...l.entries()].map(([d,p])=>({class:d,count:p})).sort((d,p)=>p.count-d.count||d.class.localeCompare(p.class));return Ct({total:e.individuals.length,classes:u,truncated:(e.truncated||[]).length>0})},history(l){if(!a(l))return It(ht.UNRESOLVED_TERM,{term:l});let d=[..._e(e,"touches"),..._e(e,"touchesSymbol")].filter(m=>m.object===l),p=new Set,f=[];for(let m of d){if(p.has(m.subject))continue;p.add(m.subject);let h=i.get(m.subject);f.push({id:m.subject,label:m.subjectLabel||h?.label||m.subject,author:h?rn(h,"author")??rn(h,"commitAuthor"):null,date:h?rn(h,"date")??rn(h,"commitDate"):null,message:h?rn(h,"message")??rn(h,"commitMessage"):null})}return Ct({commits:f})},search(l,{kind:u="",name:d="",decorator:p="",limit:f=Oa,offset:m=0}={}){let h=String(l||""),g=String(u||"").trim().toLowerCase(),b=String(d||"").trim(),y=String(p||"").trim().toLowerCase(),$;if(g&&g!=="module"){let _=null;if(b){let S=_u(b);if(S.error)return It(ht.UNRESOLVED_TERM,{term:b,detail:S.error});_=S}let v=h.toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean);try{$=Cu(e,v,{kind:g,decFilter:y,nameRe:_}).map(S=>S.ind)}catch(S){return It(ht.UNRESOLVED_TERM,{term:b,detail:String(S?.message||S)})}}else{let _=new Map;for(let v of e.individuals)(v.class||"")==="Module"&&_.set(v.label,v);$=Yh(e,h).map(({path:v})=>_.get(v)).filter(Boolean)}let E=$.slice(m,m+f).map(Qn);return Ct({results:E})},ask(l){if(typeof r!="function")return It(ht.CAPABILITY_ABSENT,"this provider was constructed without an ask answerer");let{content:u,tmct_ask:d}=r(e,String(l||""));return Ct({content:u,tmct_ask:d})}};if(o)for(let l of Sd){let u=c[l];typeof u=="function"&&(c[l]=(...d)=>{let p=performance.now(),f=u.apply(c,d);return f&&typeof f.then=="function"?f.then(m=>(Zb(o,l,performance.now()-p,m),m)):(Zb(o,l,performance.now()-p,f),f)})}return c}function Zb(e,t,n,s){try{e.record({tool:`ri.${t}`,perf:{ms_total:n},response:RA(s)})}catch{}}function RA(e){if(!e||typeof e!="object"||e.ok!==!0)return{ok:!1,reason:e?.miss?.reason||null};let t=0,n=e.value;if(Array.isArray(n))t=n.length;else if(n&&typeof n=="object")for(let s of Object.values(n))Array.isArray(s)&&(t+=s.length);return{ok:!0,count:t}}var rn,jd,jA,sc=M(()=>{De();ec();Qb();rn=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value??null;jd=200,jA=120});async function xi(e,t){let n=await t.fetchEntities(e),s=Ia(n);if(!s.individuals.length){let o=new Ne(`the graph at ${e.graphFile} is empty \u2014 no entities to answer from yet (this repo starts with no graph; the chat session folds the conversation into one).`);throw o.emptyGraph=!0,o}return s}var oc=M(()=>{Kt();De()});function no({content:e,data:t,text:n=null}){return{content:e,data:t,text:n??e}}function ft(e,t){let n=String(e?.[t]||"").trim();if(!n)throw new Ne(`${t} is required`);return n}function Ft(e,t,n){let{match:s,candidates:o}=hn(e.graph,t);if(!s)throw new Ne(`no entity matching ${n} "${t}" in the code-map graph. Try a repo-relative path (e.g. path/to/module), a basename, or tmct_search for a fuzzy lookup.`);return{match:s,candidates:o}}var Ei,gt,tt=M(()=>{Kt();De();Ei=200;gt=e=>(t,{graph:n,svc:s,config:o})=>{let{match:r}=Ft(s,ft(t,"symbol"),"symbol");return e(n,r,{toolNamePrefix:o?.toolNamePrefix})}});async function ew(e,{config:t,source:n=ar,trim:s=!1,tel:o=null}={}){let r=String(e?.symbol||"").trim();if(!r)throw new Ne("symbol is required");let i=String(e?.depth||"auto").trim().toLowerCase(),a=!!e?.min,c=!!e?.untuned,l=!!e?.max,u=t?.toolNamePrefix||"tmct_",d=await xi(t,n),p=ye(ye(t.graphFile)),f=nc(d,{sourceAccess:!0,repoRoot:p,readFile:Ie,tel:o,ask:eo}),{match:m}=Ft(f,r,"symbol"),h=fr(d,m),g,b,y=!1;a||i==="min"?(g="TINY",b=So("TINY")):l||i==="full"?(g="FULL",b=So("FULL"),y=!0):{tier:g,mask:b,topup:y}=Ma(h,d,{untuned:c}),s&&!l&&(b=gg(b));let $=null;if(h.moduleLabel)try{({lines:$}=await Ts({readFile:Ie,repoRoot:p,path:h.moduleLabel}))}catch{$=null}let E=S=>$&&$[S-1]!=null?$[S-1].trim():"",_=(S,C)=>to($,S,C,Ei).text,v=[`Edit context for ${h.moduleLabel} [${g}${s?" secondary":""}] \u2014 assembled from the typed graph + that file. You do NOT need to Read it; write the new code directly after reviewing this.`];if(b.anchor&&h.anchor?.site&&$){let{start:S,end:C}=h.anchor.site;v.push(`
70
70
  ## anchor: ${h.anchor.label} (${h.anchor.class}) @ ${h.moduleLabel}:${S}-${C}`),v.push(_(S,C)),h.callHint&&v.push(h.callHint)}if(b.registration&&h.globals.length){v.push(`
71
71
  ## registration / module globals (replicate this pattern):`);for(let S of h.globals)v.push(` ${S.label} = ${S.value}${S.site?` [:${S.site.start}]`:""}`)}if(b.exemplar&&h.exemplar?.site&&$){let{start:S,end:C}=h.exemplar.site,x=h.exemplar.decorators?` @${h.exemplar.decorators}`:"";v.push(`
72
- ## closest example (full body) \u2014 copy this style: ${h.exemplar.label} (${h.exemplar.class})${x} @ ${h.moduleLabel}:${S}-${C}`),v.push(_(S,C)),h.callHint&&v.push(h.callHint)}if(b.inlinedCallees&&h.calleeBodies.length&&$){let S=120;for(let C of h.calleeBodies){if(S<=0)break;let x=C.site.start,w=C.site.path===h.moduleLabel&&$?$:await Ts({readFile:Ce,repoRoot:p,path:C.site.path}).then(I=>I.lines).catch(()=>null);if(!w)continue;let T=eo(w,x,C.site.end,S);v.push(`
72
+ ## closest example (full body) \u2014 copy this style: ${h.exemplar.label} (${h.exemplar.class})${x} @ ${h.moduleLabel}:${S}-${C}`),v.push(_(S,C)),h.callHint&&v.push(h.callHint)}if(b.inlinedCallees&&h.calleeBodies.length&&$){let S=120;for(let C of h.calleeBodies){if(S<=0)break;let x=C.site.start,w=C.site.path===h.moduleLabel&&$?$:await Ts({readFile:Ie,repoRoot:p,path:C.site.path}).then(I=>I.lines).catch(()=>null);if(!w)continue;let T=to(w,x,C.site.end,S);v.push(`
73
73
  ## inlined callee body (depth-1 in-repo call): ${C.label} @ ${C.site.path}:${x}-${C.site.end}`),v.push(T.text),S-=T.end-x+1}}if(b.classMembers&&h.classMembers&&h.classMembers.members.length){v.push(`
74
74
  ## members of ${h.classMembers.className} (the edit likely lives INSIDE this class \u2014 copy a member's shape, do not read the class body):`);for(let S of h.classMembers.members){let C=String(S.label).split(".").pop(),x=S.params!=null&&S.params!==""?`(${S.params})${S.returns?` -> ${S.returns}`:""}`:"",R=S.decorators?`@${S.decorators} `:"",w=S.raises?` raises=${S.raises}`:"";v.push(` ${S.class} ${C}${S.site?` :${S.site.start}`:""} ${R}${C}${x}${w}`)}}if(b.siblings&&h.siblings.length){v.push(`
75
75
  ## sibling symbols to copy the style of (most relevant first; ${h.siblings.length} total):`);for(let S of h.siblings.slice(0,h.siblingCap)){let C=S.site?E(S.site.start):"",x=S.decorators?`@${S.decorators} `:"",R=S.raises?` raises=${S.raises}`:"";v.push(` ${S.class} ${S.label}${S.site?` :${S.site.start}`:""} ${x}${C}${R}`)}h.siblings.length>h.siblingCap&&v.push(` \u2026+${h.siblings.length-h.siblingCap} more (use ${u}search kind=function or ${u}snippet <name> for any of them)`)}if(b.allExports&&h.allExports&&v.push(`
@@ -82,29 +82,29 @@ ${b}`:g,tier:m})},architecture({package:l=""}={}){let u=String(l||"").trim().toL
82
82
  ## covering tests: ${h.tests.join(", ")}`),b.cochange&&h.cochange&&h.cochange.length&&v.push(`
83
83
  ## usually changed together (consider editing these too): ${h.cochange.map(S=>`${S.label} (\xD7${S.weight})`).join(", ")}`),v.push(`
84
84
  You now have the snippet, the sibling style, the registration anchor and the tests. Write the new code with Edit/Write \u2014 do NOT Read ${h.moduleLabel}.`),g!=="FULL"&&v.push(`(bundle tier ${g}; for any omitted sections run ${u}context_more {"symbol":"${r}"}, or ${u}context with depth="full".)`),{text:v.join(`
85
- `),tier:g,topup:y}}async function Ed(e,{config:t,source:n,tel:s}){return(await Xb(e,{config:t,source:n,tel:s})).text}var Sd=M(()=>{Lt();Je();Kt();Qa();ni();De();Jn();tc();nc();tt();Ed.ownsGraphLoad=!0});function Jb(e,{graph:t,svc:n}){let{match:s}=Ft(n,ft(e,"symbol"),"symbol");return mg(dr(t,s))}var Qb=M(()=>{De();tt()});function sc(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function vi(e){return sc(e).toString(16).padStart(8,"0")}function jd(e){let t=new TextEncoder().encode(String(e)),n=t.length*8,s=new Uint8Array((t.length+8>>6)+1<<6);s.set(t),s[t.length]=128;let o=new DataView(s.buffer);o.setUint32(s.length-8,Math.floor(n/4294967296)),o.setUint32(s.length-4,n>>>0);let r=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint32Array(64),a=(u,d)=>u>>>d|u<<32-d;for(let u=0;u<s.length;u+=64){for(let $=0;$<16;$+=1)i[$]=o.getUint32(u+$*4);for(let $=16;$<64;$+=1){let E=a(i[$-15],7)^a(i[$-15],18)^i[$-15]>>>3,_=a(i[$-2],17)^a(i[$-2],19)^i[$-2]>>>10;i[$]=i[$-16]+E+i[$-7]+_>>>0}let[d,p,f,m,h,g,b,y]=r;for(let $=0;$<64;$+=1){let E=a(h,6)^a(h,11)^a(h,25),_=h&g^~h&b,v=y+E+_+bA[$]+i[$]>>>0,S=a(d,2)^a(d,13)^a(d,22),C=d&p^d&f^p&f,x=S+C>>>0;y=b,b=g,g=h,h=m+v>>>0,m=f,f=p,p=d,d=v+x>>>0}r[0]=r[0]+d>>>0,r[1]=r[1]+p>>>0,r[2]=r[2]+f>>>0,r[3]=r[3]+m>>>0,r[4]=r[4]+h>>>0,r[5]=r[5]+g>>>0,r[6]=r[6]+b>>>0,r[7]=r[7]+y>>>0}let c=new Uint8Array(32),l=new DataView(c.buffer);for(let u=0;u<8;u+=1)l.setUint32(u*4,r[u]);return c}function wA(e,t){let n=jd(e),s="";for(let o=0;o<t;o+=1)s+=n[o].toString(16).padStart(2,"0");return s}function q(e){let t=As(e);return t=t.replace(/^\/c\/[a-z]{2,3}\//i,""),t=t.replace(/^[a-z][\w.-]*:/i,""),t=t.replace(/_/g," ").replace(/\s+/g," ").trim(),t=t.replace(/^(?:the|an?)\s+/i,""),t.toLowerCase()}function Zn(e){let t=As(e);return $A.get(t)??t}function ve(e,t,n){return Co(q(e),Zn(t),q(n))}var bA,yA,As,$A,Co,it=M(()=>{bA=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);yA=2e3,As=e=>String(e??"").replace(/\s+/g," ").trim().slice(0,yA);$A=new Map([["mgx:cause","mgx:causes"],["mgx:desire","mgx:desires"],["mgx:want","mgx:desires"],["mgx:require","mgx:hasPrerequisite"],["mgx:involve","mgx:hasSubevent"],["mgx:used-for","mgx:usedFor"],["mgx:made-of","mgx:madeOf"]]);Co=(e,t,n)=>`fact:${wA(`${e}\0${t}\0${n}`,8)}`});var an={};Nt(an,{CARDINALITY_RULE_CONFIDENCE:()=>kA,CAX_DW_RULE:()=>Rd,CAX_DW_RULE_CONFIDENCE:()=>Td,CAX_MAXC0_RULE_CONFIDENCE:()=>_A,CLS_SVF1_RULE:()=>Ad,CLS_SVF1_RULE_CONFIDENCE:()=>Id,DEFAULT_MAX_ENVIRONMENTS:()=>xr,DISJOINT_PREDICATE:()=>$r,ENTAILED_DISJOINT_PROVENANCE:()=>_d,ENTAILED_PROVENANCE:()=>tw,ENTAILED_SCM_SVF_PROVENANCE:()=>Pd,ENTAILED_SVF1_PROVENANCE:()=>Cd,ENTAILED_TYPE_PROVENANCE:()=>sw,ON_PROPERTY_PREDICATE:()=>jn,SCM_SVF_RULE:()=>Ld,SCM_SVF_RULE_CONFIDENCE:()=>Md,SOME_VALUES_FROM_PREDICATE:()=>kn,SUBCLASS_PREDICATE:()=>Be,TYPE_PREDICATE:()=>Dt,buildCardinalityRestrictions:()=>Nd,buildRelevanceFrontier:()=>kd,buildSubClassSuccessors:()=>oc,deriveDisjointViolations:()=>aw,deriveSomeValuesFromApplication:()=>cw,deriveSomeValuesFromSubsumption:()=>lw,deriveSubClassClosure:()=>ow,deriveSubClassClosureDelta:()=>rw,deriveTypePropagation:()=>iw,entailedTrustFrom:()=>xA,findConsistencyViolations:()=>AA,findIsaChain:()=>Fd,proveCardinalityAtLeast:()=>RA,proveMaxCardinalityZeroDenial:()=>TA,retractSubClassOf:()=>NA,syllogise:()=>dw});function Zb(e,t,n){for(let s of t)if(typeof e?.[s]!="function")throw new TypeError(`${n} needs a store option carrying { ${t.join(", ")} } (memory/core.mjs's read/write functions) \u2014 missing ${s}`);return e}function xA(e,t=1){let n=(Array.isArray(e)?e:[]).filter(o=>typeof o=="number");if(!n.length)return null;let s=Math.max(0,Math.min(1,Math.min(...n)*t));return Number(s.toFixed(6))}function Cs(e){if(!e)return null;let t=e instanceof Set?[...e]:Array.isArray(e)?e:[],n=new Set;for(let s of t){let o=q(s);o&&n.add(o)}return n.size?n:null}function ow(e,{depth:t=32,budget:n=50,focus:s=null}={}){let o=new Set,r=new Map;for(let[u,d]of e||[])!u||!d||u===d||(o.add(`${u}${We}${d}`),r.has(u)||r.set(u,new Set),r.get(u).add(d));let i=s instanceof Set?s.size?s:null:Cs(s),a=(u,d,p)=>!i||i.has(u)||i.has(d)||i.has(p),c=[],l=new Set;for(let u=0;u<t;u+=1){let d=[];for(let[f,m]of r)for(let h of m){let g=r.get(h);if(g)for(let b of g){if(f===b)continue;let y=`${f}${We}${b}`;o.has(y)||l.has(y)||a(f,h,b)&&d.push([f,h,b,y])}}if(!d.length)break;d.sort((f,m)=>f[0].localeCompare(m[0])||f[2].localeCompare(m[2])||f[1].localeCompare(m[1]));let p=!1;for(let[f,m,h,g]of d)if(!l.has(g)){if(c.length>=n)break;l.add(g),c.push({subject:f,object:h,via:m}),r.has(f)||r.set(f,new Set),r.get(f).add(h),p=!0}if(c.length>=n||!p)break}return c}function rw(e,t,{depth:n=32,budget:s=50,focus:o=null}={}){let r=new Set,i=new Map,a=new Map;for(let[m,h]of e||[])!m||!h||m===h||(r.add(`${m}${We}${h}`),i.has(m)||i.set(m,new Set),i.get(m).add(h),a.has(h)||a.set(h,new Set),a.get(h).add(m));let c=[],l=new Set;for(let[m,h]of t||[]){if(!m||!h||m===h)continue;let g=`${m}${We}${h}`;l.has(g)||(l.add(g),c.push([m,h]))}let u=o instanceof Set?o.size?o:null:Cs(o),d=(m,h,g)=>!u||u.has(m)||u.has(h)||u.has(g),p=[],f=new Set;for(let m=0;m<n&&c.length;m+=1){let h=[],g=($,E,_)=>{if($===_)return;let v=`${$}${We}${_}`;r.has(v)||f.has(v)||d($,E,_)&&h.push([$,E,_,v])};for(let[$,E]of c){for(let _ of i.get(E)||[])g($,E,_);for(let _ of a.get($)||[])g(_,$,E)}if(!h.length)break;h.sort(($,E)=>$[0].localeCompare(E[0])||$[2].localeCompare(E[2])||$[1].localeCompare(E[1]));let b=!1,y=[];for(let[$,E,_,v]of h)if(!f.has(v)){if(p.length>=s)break;f.add(v),p.push({subject:$,object:_,via:E}),i.has($)||i.set($,new Set),i.get($).add(_),a.has(_)||a.set(_,new Set),a.get(_).add($),y.push([$,_]),b=!0}if(p.length>=s||!b)break;c=y}return p}function es(e){let t=new Map;for(let[s,o]of e||[])!s||!o||s===o||(t.has(s)||t.set(s,new Set),t.get(s).add(o));let n=new Map;return s=>{if(n.has(s))return n.get(s);let o=new Set,r=[...t.get(s)||[]];for(;r.length;){let i=r.pop();if(!o.has(i)){o.add(i);for(let a of t.get(i)||[])o.has(a)||r.push(a)}}return n.set(s,o),o}}function EA(e){return es((e||[]).map(([t,n])=>[n,t]))}function kd(e,t){let n=[],s=[],o=new Map,r=new Map;for(let l of e||[])!l||!l.subject||!l.predicate||!l.object||(no(l.predicate)?n.push([l.subject,l.object]):Oo(l.predicate)?s.push([l.subject,l.object]):vr(l.predicate)?o.set(l.subject,l.object):Ei(l.predicate)&&r.set(l.subject,l.object));let i=EA(n),a=new Set;for(let l of t||[]){let u=q(l);if(u){a.add(u);for(let d of i(u))a.add(d)}}let c=new Set(a);for(let[l,u]of s)a.has(u)&&c.add(l);for(let[l,u]of r)o.has(l)&&a.has(u)&&c.add(l);return c}function iw(e,t,{budget:n=50,focus:s=null,presentTypeEdges:o=e}={}){let r=es(t),i=new Set,a=new Set;for(let[f,m]of o||[])f&&m&&i.add(`${f}${We}${m}`);let c=s instanceof Set?s.size?s:null:Cs(s),l=(f,m,h)=>!c||c.has(f)||c.has(m)||c.has(h),u=[];for(let[f,m]of e||[]){if(!f||!m)continue;let h=`${f}${We}${m}`;if(!a.has(h)){a.add(h);for(let g of r(m)){if(g===m||g===f)continue;let b=`${f}${We}${g}`;i.has(b)||l(f,m,g)&&u.push([f,m,g,b])}}}u.sort((f,m)=>f[0].localeCompare(m[0])||f[2].localeCompare(m[2])||f[1].localeCompare(m[1]));let d=[],p=new Set;for(let[f,m,h,g]of u)if(!p.has(g)){if(d.length>=n)break;p.add(g),d.push({subject:f,object:h,via:m})}return d}function aw(e,t,n,{budget:s=50,focus:o=null}={}){let r=es(t),i=new Map,a=new Set;for(let[m,h]of n||[])!m||!h||m===h||(a.add(`${m}${We}${h}`),a.add(`${h}${We}${m}`),i.has(m)||i.set(m,new Set),i.get(m).add(h),i.has(h)||i.set(h,new Set),i.get(h).add(m));if(!i.size)return[];let c=new Set,l=o instanceof Set?o.size?o:null:Cs(o),u=(m,h,g)=>!l||l.has(m)||l.has(h)||l.has(g),d=[];for(let[m,h]of e||[]){if(!m||!h)continue;let g=`${m}${We}${h}`;if(!c.has(g)){c.add(g);for(let b of[h,...r(h)]){let y=i.get(b);if(y)for(let $ of y){if($===m)continue;let E=`${m}${We}${$}`;a.has(E)||u(m,h,$)&&d.push([m,h,b,$,E])}}}}d.sort((m,h)=>m[0].localeCompare(h[0])||m[3].localeCompare(h[3])||m[2].localeCompare(h[2])||m[1].localeCompare(h[1]));let p=[],f=new Set;for(let[m,h,g,b,y]of d)if(!f.has(y)){if(p.length>=s)break;f.add(y),p.push({subject:m,object:b,viaType:h,viaClass:g})}return p}function cw(e,t,n,s,{budget:o=50,focus:r=null}={}){let i=es(n),a=new Map;for(let g of s||[]){if(!g||!g.restriction||!g.property||!g.target)continue;let b=`${g.property}${We}${g.target}`;a.has(b)||a.set(b,new Set),a.get(b).add(g.restriction)}if(!a.size)return[];let c=new Set,l=new Map;for(let[g,b]of t||[])!g||!b||(c.add(`${g}${We}${b}`),l.has(g)||l.set(g,new Set),l.get(g).add(b));let u=r instanceof Set?r.size?r:null:Cs(r),d=(g,b,y)=>!u||u.has(g)||u.has(b)||u.has(y),p=new Set,f=[];for(let[g,b,y]of e||[]){if(!g||!b||!y)continue;let $=q(b),E=`${g}${We}${$}${We}${y}`;if(p.has(E))continue;p.add(E);let _=l.get(y);if(_)for(let v of _)for(let S of[v,...i(v)]){let C=a.get(`${$}${We}${S}`);if(C)for(let x of C){if(g===x)continue;let R=`${g}${We}${x}`;c.has(R)||d(g,y,x)&&f.push([g,b,$,y,v,S,x,R])}}}f.sort((g,b)=>g[0].localeCompare(b[0])||g[6].localeCompare(b[6])||g[1].localeCompare(b[1])||g[3].localeCompare(b[3]));let m=[],h=new Set;for(let[g,b,y,$,E,_,v,S]of f)if(!h.has(S)){if(m.length>=o)break;h.add(S),m.push({subject:g,object:v,viaProperty:b,viaPropertyKey:y,viaValue:$,viaType:E,viaTarget:_})}return m}function Nd(e){let t=new Map,n=new Map,s=new Map;for(let r of e||[])if(!(!r||!r.subject||!r.predicate))if(vr(r.predicate))t.set(r.subject,r.object);else if(vA(r.predicate))s.set(r.subject,r.object);else{let i=jA[String(r.predicate).trim().toLowerCase()];if(!i)continue;let a=Number(r.object);Number.isFinite(a)&&n.set(r.subject,{kind:i,n:a})}let o=[];for(let[r,{kind:i,n:a}]of n){if(t.get(r)!==SA)continue;let c=s.get(r);c&&o.push({restriction:r,kind:i,n:a,onClass:c})}return o.sort((r,i)=>r.restriction.localeCompare(i.restriction)),o}function lw(e,t,{budget:n=50,focus:s=null}={}){let o=es(t),r=new Map;for(let p of e||[]){if(!p||!p.restriction||!p.property||!p.target)continue;let f=q(p.property);r.has(f)||r.set(f,[]),r.get(f).push({restriction:p.restriction,target:p.target})}let i=new Set;for(let[p,f]of t||[])p&&f&&i.add(`${p}${We}${f}`);let a=s instanceof Set?s.size?s:null:Cs(s),c=(p,f)=>!a||a.has(p)||a.has(f),l=[];for(let[,p]of r)if(!(p.length<2))for(let f of p)for(let m of p){if(f.restriction===m.restriction||f.target===m.target||!o(f.target).has(m.target))continue;let h=`${f.restriction}${We}${m.restriction}`;i.has(h)||c(f.restriction,m.restriction)&&l.push([f.restriction,m.restriction,f.target,m.target,h])}l.sort((p,f)=>p[0].localeCompare(f[0])||p[1].localeCompare(f[1]));let u=[],d=new Set;for(let[p,f,m,h,g]of l)if(!d.has(g)){if(u.length>=n)break;d.add(g),u.push({subject:p,object:f,viaY1:m,viaY2:h})}return u}function uw(e,t,n,s,{budget:o=20,focus:r=null}={}){if(!n)return null;let i=es(e),a=r instanceof Set?r.size?r:null:Cs(r),c=p=>!a||a.has(n)||a.has(p),l=new Map;for(let[p,f]of e||[])!p||!f||(l.has(p)||l.set(p,new Set),l.get(p).add(f));let u=new Map((t||[]).map(p=>[p.restriction,p])),d=0;for(let p of[n,...i(n)]){if(d>=o)break;if(d+=1,!!c(p))for(let f of l.get(p)||[]){let m=u.get(f);if(m&&s(m))return{viaClass:p,viaRestriction:f,record:m}}}return null}function RA(e,t,n,s,o,r={}){if(!s||!Number.isFinite(o))return null;let i=uw(e,t,n,a=>a.onClass===s&&(a.kind==="exactly"||a.kind==="min")&&a.n>=o,r);return i?{subject:n,object:s,m:o,n:i.record.n,kind:i.record.kind,viaClass:i.viaClass,viaRestriction:i.viaRestriction}:null}function TA(e,t,n,s,o={}){if(!s)return null;let r=uw(e,t,n,i=>i.onClass===s&&i.kind==="max"&&i.n===0,o);return r?{subject:n,object:s,viaClass:r.viaClass,viaRestriction:r.viaRestriction}:null}function AA(e,t,n,{budget:s=50,focus:o=null}={}){let r=es(t),i=new Map;for(let[f,m]of n||[])!f||!m||f===m||(i.has(f)||i.set(f,new Set),i.get(f).add(m),i.has(m)||i.set(m,new Set),i.get(m).add(f));if(!i.size)return[];let a=new Map;for(let[f,m]of e||[])!f||!m||(a.has(f)||a.set(f,new Set),a.get(f).add(m));let c=o instanceof Set?o.size?o:null:Cs(o),l=f=>!c||c.has(f),u=[],d=new Set;for(let[f,m]of a){if(!l(f))continue;let h=[...m].sort();for(let g=0;g<h.length;g+=1)for(let b=g+1;b<h.length;b+=1){let[y,$]=[h[g],h[b]],E=[y,...r(y)],_=[$,...r($)],v=null;for(let C of E){let x=i.get(C);if(x){for(let R of _)if(x.has(R)){v=[C,R];break}if(v)break}}if(!v)continue;let S=`${f}${We}${y}${We}${$}`;d.has(S)||(d.add(S),u.push([f,y,$,v[0],v[1]]))}}u.sort((f,m)=>f[0].localeCompare(m[0])||f[1].localeCompare(m[1])||f[2].localeCompare(m[2]));let p=[];for(let[f,m,h,g,b]of u){if(p.length>=s)break;p.push({subject:f,classA:m,classB:h,viaA:g,viaB:b})}return p}async function dw(e,{depth:t=32,budget:n=50,focus:s=null,expandFocus:o=!1,maxEnvironments:r=xr,full:i=!1,store:a}={}){let{loadMemory:c,readFactRows:l,appendFacts:u}=Zb(a,["loadMemory","readFactRows","appendFacts"],"syllogise"),d=typeof a?.loadSyllogiseState=="function"&&typeof a?.saveSyllogiseState=="function",p=await c(e),f=l(p),m=f.filter(A=>no(A.predicate)).map(A=>[A.subject,A.object]),h=f.filter(A=>Oo(A.predicate)).map(A=>[A.subject,A.object]),g=f.filter(A=>Io(A.predicate)).map(A=>[A.subject,A.object]),b=new Map,y=new Map,$=[];for(let A of f){let he=String(A.predicate||"").trim().toLowerCase();vr(A.predicate)?b.set(A.subject,A.object):Ei(A.predicate)?y.set(A.subject,A.object):Od.has(he)||$.push([A.subject,A.predicate,A.object])}let E=[];for(let[A,he]of b){let Ie=y.get(A);Ie&&E.push({restriction:A,property:he,target:Ie})}let _=Cs(s),v=o&&_?kd(f,[..._]):_,S=v===null&&d?await a.loadSyllogiseState(e):null,C=new Set(f.map(A=>A.id)),x=Array.isArray(S?.factIds)?S.factIds.filter(A=>!C.has(A)):[],R=S&&Array.isArray(S.factIds)&&!x.length&&!i?"delta":"full",w=R==="delta"?new Set(S.factIds):null,T=R==="delta"?f.filter(A=>!w.has(A.id)):f,I=T.length,j=new Map;for(let A of f)j.set(`${A.subject}${We}${A.predicate}${We}${A.object}`,A.trust);let k=(A,he,Ie)=>j.get(`${A}${We}${he}${We}${Ie}`),P=(A,he,Ie)=>j.has(`${A}${We}${he}${We}${Ie}`),U=A=>A.filter(he=>typeof he=="number"),H=R==="delta"&&!T.length,X=R==="delta"?T.filter(A=>no(A.predicate)).map(A=>[A.subject,A.object]):[],Q=R==="delta"?X.length?rw(m,X,{depth:t,budget:n,focus:v}):[]:ow(m,{depth:t,budget:n,focus:v}),L=m.concat(Q.map(A=>[A.subject,A.object])),V=v,W=null;if(R==="delta"&&!H){let A=f.concat(Q.map(Ie=>({subject:Ie.subject,predicate:Be,object:Ie.object}))),he=[];for(let Ie of T)he.push(Ie.subject,Ie.object);W=kd(A,he),V=W}let O=A=>!W||W.has(A),D=W?h.filter(([A,he])=>O(A)||O(he)):h,N=new Set;if(W)for(let A of T)Io(A.predicate)&&(N.add(A.subject),N.add(A.object));let F=W&&N.size?es(L):null,z=W?h.filter(([A,he])=>O(A)||O(he)||F&&[...F(he)].some(Ie=>N.has(Ie))):h,B=new Set;if(W){for(let A of T)if(vr(A.predicate)||Ei(A.predicate)){let he=b.get(A.subject);he&&B.add(q(he))}}let G=W?$.filter(([A,he,Ie])=>O(A)||O(Ie)||B.has(q(he))):$,J=Math.max(0,n-Q.length),ie=J>0&&!H?iw(D,L,{budget:J,focus:V,presentTypeEdges:h}):[],de=Math.max(0,n-Q.length-ie.length),ae=de>0&&!H?aw(z,L,g,{budget:de,focus:V}):[],Z=Math.max(0,n-Q.length-ie.length-ae.length),Y=Z>0&&E.length&&!H?cw(G,h,L,E,{budget:Z,focus:V}):[],te=Math.max(0,n-Q.length-ie.length-ae.length-Y.length),re=te>0&&E.length>1&&!H?lw(E,L,{budget:te,focus:V}):[],Te=new Map(E.map(A=>[A.restriction,A])),fe=[...Q.map(A=>({subject:A.subject,predicate:Be,object:A.object,provenance:tw,justification:[[ve(A.subject,Be,A.via),ve(A.via,Be,A.object)]]})),...ie.map(A=>({subject:A.subject,predicate:Dt,object:A.object,provenance:sw,justification:[[ve(A.subject,Dt,A.via),ve(A.via,Be,A.object)]]})),...ae.map(A=>{let he=P(A.viaClass,$r,A.object),[Ie,hs]=he?[A.viaClass,A.object]:[A.object,A.viaClass],gs=U([k(A.subject,Dt,A.viaType),k(Ie,$r,hs),...A.viaClass!==A.viaType?[k(A.viaType,Be,A.viaClass)]:[]]);return{subject:A.subject,predicate:$r,object:A.object,provenance:_d,justification:[[ve(A.subject,Dt,A.viaType),ve(Ie,$r,hs),...A.viaClass!==A.viaType?[ve(A.viaType,Be,A.viaClass)]:[]]],...gs.length?{premiseTrusts:gs,ruleConfidence:Td}:{}}}),...Y.map(A=>{let he=U([k(A.subject,A.viaProperty,A.viaValue),k(A.viaValue,Dt,A.viaType),k(A.object,jn,A.viaPropertyKey),k(A.object,kn,A.viaTarget),...A.viaType!==A.viaTarget?[k(A.viaType,Be,A.viaTarget)]:[]]);return{subject:A.subject,predicate:Dt,object:A.object,provenance:Cd,justification:[[ve(A.subject,A.viaProperty,A.viaValue),ve(A.viaValue,Dt,A.viaType),ve(A.object,jn,A.viaPropertyKey),ve(A.object,kn,A.viaTarget),...A.viaType!==A.viaTarget?[ve(A.viaType,Be,A.viaTarget)]:[]]],...he.length?{premiseTrusts:he,ruleConfidence:Id}:{}}}),...re.map(A=>{let he=Te.get(A.subject),Ie=Te.get(A.object),hs=U([he&&k(A.subject,jn,he.property),k(A.subject,kn,A.viaY1),Ie&&k(A.object,jn,Ie.property),k(A.object,kn,A.viaY2),k(A.viaY1,Be,A.viaY2)]);return{subject:A.subject,predicate:Be,object:A.object,provenance:Pd,justification:[[...he?[ve(A.subject,jn,he.property)]:[],ve(A.subject,kn,A.viaY1),...Ie?[ve(A.object,jn,Ie.property)]:[],ve(A.object,kn,A.viaY2),ve(A.viaY1,Be,A.viaY2)]],...hs.length?{premiseTrusts:hs,ruleConfidence:Md}:{}}})],Se=fe.map(A=>({id:ve(A.subject,A.predicate,A.object),subject:A.subject,predicate:A.predicate,object:A.object,environments:A.justification,write:A})),Le=pw(f.concat(Se.map(A=>({id:A.id,subject:A.subject,predicate:A.predicate,object:A.object})))),je=new Map(f.map(A=>[A.id,A])),Ye=A=>no(A)||Oo(A)||Io(A),ce=A=>R!=="delta"||W!==null&&(W.has(A.subject)||W.has(A.object)),le=f.filter(A=>Ye(A.predicate)&&fw(A.provenance)&&xi(A).length<r&&ce(A)).map(A=>({id:A.id,subject:A.subject,predicate:A.predicate,object:A.object,environments:xi(A),provenance:A.provenance})),pe=[...Se,...le].sort((A,he)=>A.subject.localeCompare(he.subject)||A.predicate.localeCompare(he.predicate)||A.object.localeCompare(he.object)),Xe=0,wt=!1,se=0;for(let A of pe){if(se>=n){wt=!0;break}se+=1;let he=Le(A,{maxEnvironments:r+1}),{kept:Ie,truncated:hs}=IA(A.environments,he,r);if(hs&&(wt=!0),!(Ie.length<=A.environments.length)){if(Xe+=Ie.length-A.environments.length,A.write){A.write.justification=Ie;continue}fe.push({subject:A.subject,predicate:A.predicate,object:A.object,justification:Ie,...mw(A.provenance,Ie,gs=>je.get(gs)?.trust)||{}})}}let{ids:Pe}=await u(e,fe),st=[],Ue=0;for(let A of Q)st.push({id:Pe[Ue],subject:A.subject,object:A.object,via:A.via,rule:ew}),Ue+=1;for(let A of ie)st.push({id:Pe[Ue],subject:A.subject,object:A.object,via:A.via,rule:nw}),Ue+=1;for(let A of ae)st.push({id:Pe[Ue],subject:A.subject,object:A.object,via:A.viaClass,rule:Rd}),Ue+=1;for(let A of Y)st.push({id:Pe[Ue],subject:A.subject,object:A.object,via:A.viaValue,rule:Ad}),Ue+=1;for(let A of re)st.push({id:Pe[Ue],subject:A.subject,object:A.object,via:A.viaY1,rule:Ld}),Ue+=1;let Us=st.length>=n;if(v===null&&d&&!Us){let A=new Set(C);for(let he of Pe)A.add(he);await a.saveSyllogiseState(e,{version:1,factIds:[...A].sort(),completedAt:new Date().toISOString()})}return{derived:st,count:st.length,budget:n,depth:t,truncated:Us,mode:R,deltaSize:I,environmentsAdded:Xe,alternatesTruncated:wt}}function fw(e){let t=String(e||"").split(" | ").filter(Boolean);return t.length>0&&t.every(n=>n.startsWith("entailed:"))}function CA(e){let t=[],n=new Map,s=new Map,o=new Map,r=new Map,i=new Map;for(let u of e){let d=String(u.predicate||"").trim().toLowerCase();no(u.predicate)?t.push([u.subject,u.object]):Oo(u.predicate)?(n.has(u.subject)||n.set(u.subject,new Set),n.get(u.subject).add(u.object)):Io(u.predicate)?(s.has(u.subject)||s.set(u.subject,new Set),s.get(u.subject).add(u.object),s.has(u.object)||s.set(u.object,new Set),s.get(u.object).add(u.subject)):vr(u.predicate)?o.set(u.subject,u.object):Ei(u.predicate)?r.set(u.subject,u.object):Od.has(d)||(i.has(u.subject)||i.set(u.subject,[]),i.get(u.subject).push([q(u.predicate),u.object]))}let a=es(t),c=(u,d)=>u!==d&&a(u).has(d),l=u=>{let d=o.get(u),p=r.get(u);return d&&p?{property:q(d),target:p}:null};return u=>{if(no(u.predicate)){if(c(u.subject,u.object))return!0;let d=l(u.subject),p=l(u.object);return!!(d&&p&&d.property===p.property&&c(d.target,p.target))}if(Oo(u.predicate)){for(let p of n.get(u.subject)||[])if(c(p,u.object))return!0;let d=l(u.object);if(d){for(let[p,f]of i.get(u.subject)||[])if(p===d.property){for(let m of n.get(f)||[])if(m===d.target||c(m,d.target))return!0}}return!1}if(Io(u.predicate)){for(let d of n.get(u.subject)||[])for(let p of[d,...a(d)])if(s.get(p)?.has(u.object))return!0;return!1}return!0}}function pw(e){let t=new Set,n=[],s=new Map,o=new Map,r=new Set,i=new Map,a=new Map,c=new Map,l=new Map;for(let f of e){if(!f||!f.subject||!f.predicate||!f.object)continue;f.id&&t.add(f.id);let m=String(f.predicate||"").trim().toLowerCase();no(f.predicate)?(n.push([f.subject,f.object]),s.has(f.subject)||s.set(f.subject,new Set),s.get(f.subject).add(f.object)):Oo(f.predicate)?(o.has(f.subject)||o.set(f.subject,new Set),o.get(f.subject).add(f.object)):Io(f.predicate)?(r.add(`${f.subject}${We}${f.object}`),i.has(f.subject)||i.set(f.subject,new Set),i.get(f.subject).add(f.object),i.has(f.object)||i.set(f.object,new Set),i.get(f.object).add(f.subject)):vr(f.predicate)?a.set(f.subject,f.object):Ei(f.predicate)?c.set(f.subject,f.object):Od.has(m)||(l.has(f.subject)||l.set(f.subject,[]),l.get(f.subject).push([f.predicate,f.object]))}let u=es(n),d=f=>s.get(f)||new Set,p=f=>{let m=a.get(f),h=c.get(f);return m&&h?{property:m,propertyKey:q(m),target:h}:null};return(f,{maxEnvironments:m=xr}={})=>{let h=[],g=new Set,b=y=>{if(h.length>=m||f.id&&y.includes(f.id)||!y.every(E=>t.has(E)))return;let $=[...y].sort().join(" ");g.has($)||(g.add($),h.push(y))};if(no(f.predicate)){for(let y of[...d(f.subject)].sort()){if(h.length>=m)break;y===f.subject||y===f.object||d(y).has(f.object)&&b([ve(f.subject,Be,y),ve(y,Be,f.object)])}if(h.length<m){let y=p(f.subject),$=p(f.object);y&&$&&y.propertyKey===$.propertyKey&&y.target!==$.target&&d(y.target).has($.target)&&b([ve(f.subject,jn,y.property),ve(f.subject,kn,y.target),ve(f.object,jn,$.property),ve(f.object,kn,$.target),ve(y.target,Be,$.target)])}return h}if(Oo(f.predicate)){for(let $ of[...o.get(f.subject)||[]].sort()){if(h.length>=m)break;$!==f.object&&d($).has(f.object)&&b([ve(f.subject,Dt,$),ve($,Be,f.object)])}let y=p(f.object);if(y){let $=[...l.get(f.subject)||[]].filter(([E])=>q(E)===y.propertyKey).sort((E,_)=>E[0].localeCompare(_[0])||E[1].localeCompare(_[1]));for(let[E,_]of $){if(h.length>=m)break;for(let v of[...o.get(_)||[]].sort()){if(h.length>=m)break;v!==y.target&&!d(v).has(y.target)||b([ve(f.subject,E,_),ve(_,Dt,v),ve(f.object,jn,y.propertyKey),ve(f.object,kn,y.target),...v!==y.target?[ve(v,Be,y.target)]:[]])}}}return h}if(Io(f.predicate)){let y=[];for(let $ of o.get(f.subject)||[])for(let E of[$,...u($)])(i.get(E)||new Set).has(f.object)&&y.push([$,E]);y.sort(($,E)=>$[0].localeCompare(E[0])||$[1].localeCompare(E[1]));for(let[$,E]of y){if(h.length>=m)break;let _=r.has(`${E}${We}${f.object}`),[v,S]=_?[E,f.object]:[f.object,E];b([ve(f.subject,Dt,$),ve(v,$r,S),...E!==$?[ve($,Be,E)]:[]])}return h}return h}}function IA(e,t,n){let s=[],o=new Set,r=!1;for(let i of[...e||[],...t||[]]){if(!Array.isArray(i)||!i.length)continue;let a=[...i].sort().join(" ");if(!o.has(a)){if(s.length>=n){r=!0;continue}o.add(a),s.push(i)}}return{kept:s,truncated:r}}function mw(e,t,n){let s;for(let i of String(e||"").split(" | ")){let a=OA.get(i);if(a!==void 0){s=a;break}}if(s===void 0)return null;let o=null,r=-1;for(let i of t||[]){let a=i.map(l=>n(l)).filter(l=>typeof l=="number");if(a.length!==i.length)continue;let c=Math.min(...a);c>r&&(r=c,o=a)}return o?{premiseTrusts:o,ruleConfidence:s}:null}async function NA(e,t,n,{budget:s=50,depth:o=32,maxEnvironments:r=xr,store:i,sourceTags:a=[],predicate:c=Be}={}){let{loadMemory:l,readFactRows:u,removeFacts:d}=Zb(i,["loadMemory","readFactRows","removeFacts"],"retractSubClassOf"),p=typeof i?.appendFacts=="function"?i.appendFacts:null,f=typeof i?.factRecordIdForTag=="function"?i.factRecordIdForTag:null,m=(a||[]).filter(Boolean);if(m.length&&!f)throw new TypeError("retractSubClassOf needs a store option carrying factRecordIdForTag (memory/core.mjs's) to scope a retraction to sourceTags");let h=q(t),g=q(n),b=ve(h,c,g),y=await l(e),$=u(y),E=new Map($.map(P=>[P.id,P]));if(!E.has(b))return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!1};let _=E.get(b).sourceIds||[],v=m.map(P=>f(b,P).slice(b.length+1)),S=m.length?_.filter(P=>v.includes(P)):[],C=!m.length||S.length>0;if(m.length&&!C)return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!0,ownRecord:!1,stillStands:!0};let x=m.length>0&&S.length<_.length,R=new Set([b]),w=[b],T=new Map,I=!1;if(!x){let P=$.filter(Q=>xi(Q).length&&fw(Q.provenance)),U=new Map;for(let Q of P)for(let L of xi(Q))for(let V of L)U.has(V)||U.set(V,new Set),U.get(V).add(Q.id);let H=0,X=[b];for(;H<o;H+=1){let Q=new Set;for(let z of X)for(let B of U.get(z)||[])R.has(B)||Q.add(B);let L=[...Q].map(z=>E.get(z)).sort((z,B)=>z.subject.localeCompare(B.subject)||z.predicate.localeCompare(B.predicate)||z.object.localeCompare(B.object));if(!L.length)break;let V=$.filter(z=>!R.has(z.id)&&!Q.has(z.id)),W=new Set(V.map(z=>z.id)),O=pw(V),D=CA(V),N=!1,F=!1;X=[];for(let z of L){if(R.size>=s){F=!0;break}let B=xi(z),G=B.filter(ie=>ie.every(de=>W.has(de)));if(G.length){G.length!==B.length&&T.set(z.id,G);continue}let J=O(z,{maxEnvironments:r});if(J.length){T.set(z.id,J);continue}D(z)||(R.add(z.id),w.push(z.id),X.push(z.id),N=!0)}if(F){I=!0;break}if(!N)break}!I&&H>=o&&(I=P.some(Q=>!R.has(Q.id)&&Q.justification.some(L=>R.has(L))))}let j=m.length?[...S.map(P=>`${b}@${P}`),...w.slice(1)]:w,{removed:k}=await d(e,j);if(p){let P=[...T.entries()].filter(([U])=>!R.has(U)).sort((U,H)=>U[0].localeCompare(H[0])).map(([U,H])=>{let X=E.get(U);return{subject:X.subject,predicate:X.predicate,object:X.object,justification:H,...mw(X.provenance,H,Q=>E.get(Q)?.trust)||{}}});P.length&&await p(e,P)}return{retracted:k,count:k.length,budget:s,depth:o,truncated:I,found:!0,...m.length?{ownRecord:!0,stillStands:x}:{}}}function oc(e){let t=new Map;for(let[n,s]of e||[])!n||!s||n===s||(t.has(n)||t.set(n,new Set),t.get(n).add(s));return t}function Fd(e,t,n,s,{maxHops:o=6}={}){let r=t instanceof Set?t:new Set(t||[]),i=s instanceof Map?s:oc(s),a=[];for(let[l,u]of n||[])l===e&&u&&a.push({node:u,path:[{subject:l,predicate:Dt,object:u}]});for(let l of i.get(e)||[])a.push({node:l,path:[{subject:e,predicate:Be,object:l}]});let c=new Set([e]);for(let l=1;l<=o&&a.length;l+=1){for(let{node:d,path:p}of a)if(r.has(d))return p;if(l===o)break;let u=[];for(let{node:d,path:p}of a)if(!c.has(d)){c.add(d);for(let f of i.get(d)||[])c.has(f)||u.push({node:f,path:[...p,{subject:d,predicate:Be,object:f}]})}a=u}return null}var Be,ew,tw,Dt,nw,sw,$r,Rd,_d,Td,jn,kn,Ad,Cd,Id,xr,We,no,Oo,Io,vr,Ei,vA,Od,SA,jA,Ld,Pd,Md,kA,_A,xi,OA,It=M(()=>{it();Be="rdfs:subClassOf",ew="subClassOf",tw=`entailed:${ew}`,Dt="rdf:type",nw="type",sw=`entailed:${nw}`,$r="owl:disjointWith",Rd="disjointWith",_d=`entailed:${Rd}`,Td=.95,jn="owl:onProperty",kn="owl:someValuesFrom",Ad="someValuesFrom",Cd=`entailed:${Ad}`,Id=.95,xr=4,We="\u241F",no=e=>String(e||"").trim().toLowerCase()==="rdfs:subclassof",Oo=e=>String(e||"").trim().toLowerCase()==="rdf:type",Io=e=>String(e||"").trim().toLowerCase()==="owl:disjointwith",vr=e=>String(e||"").trim().toLowerCase()==="owl:onproperty",Ei=e=>String(e||"").trim().toLowerCase()==="owl:somevaluesfrom",vA=e=>String(e||"").trim().toLowerCase()==="owl:onclass",Od=new Set(["rdfs:subclassof","rdf:type","owl:disjointwith","owl:onproperty","owl:somevaluesfrom","owl:intersectionof"]);SA="has",jA={"owl:cardinality":"exactly","owl:mincardinality":"min","owl:maxcardinality":"max"};Ld="someValuesFromSubsumption",Pd=`entailed:${Ld}`,Md=.95;kA=.95;_A=.95;xi=e=>e.environments||(Array.isArray(e.justification)&&e.justification.length?[e.justification]:[]);OA=new Map([[_d,Td],[Cd,Id],[Pd,Md]])});function kr(e){let t=String(e||""),n=hw.get(t);return n||(t.startsWith(Dd)?Er+t.slice(Dd.length):t)}function gw(e){let t=String(e||""),n=LA.get(t);return n||(t.startsWith(Er)?Dd+t.slice(Er.length):null)}function yw(e,t,n,s,o){let r=null;for(let i of e){if(i===t)return[];let a=Fd(i,new Set([t]),n,s,{maxHops:o});a&&(!r||a.length<r.length)&&(r=a)}return r}function ac(e,t,n,{maxHops:s=3}={}){let o=jr(e),r=jr(t),i=Array.isArray(n)?n:[],{typeEdges:a,subClassSucc:c}=ww(i),l=i.filter(b=>(b.predicate===ic||b.predicate===Sr)&&r.has(b.object)),u=[];for(let b of l){let y=b.predicate===Sr?"negative":"positive";if(o.has(b.subject)){u.push({fact:b,polarity:y,hops:0,chain:null});continue}let $=yw(o,b.subject,a,c,s);$&&$.length&&u.push({fact:b,polarity:y,hops:$.length,chain:$})}if(!u.length)return{verdict:"none",hops:0,positive:[],negative:[],chain:null,overrides:null,baseRate:Ud(o,r,i,{maxHops:s})};u.sort((b,y)=>b.hops-y.hops||(y.fact.trust||0)-(b.fact.trust||0));let d=u[0].hops,p=u.filter(b=>b.hops===d),f=p.filter(b=>b.polarity==="positive").map(b=>b.fact),m=p.filter(b=>b.polarity==="negative").map(b=>b.fact),h=m.length&&!f.length?"negative":"positive",g=u.find(b=>b.hops>d&&b.polarity!==h)||null;return{verdict:f.length&&m.length?"both":m.length?"no":"yes",hops:d,positive:f,negative:m,chain:u[0].chain,overrides:g?{fact:g.fact,chain:g.chain}:null,baseRate:null}}function Ud(e,t,n,{maxHops:s=3}={}){let o=jr(e),r=jr(t),i=Array.isArray(n)?n:[],a=i.filter(h=>h.predicate===Be||h.predicate===Dt),c=a.filter(h=>o.has(h.subject)).map(h=>h.object);if(!c.length)return null;let l=c[0],u=[...new Set(a.filter(h=>h.object===l&&!o.has(h.subject)).map(h=>h.subject))],d=h=>{let g=i.find(b=>b.subject===h&&r.has(b.object)&&(b.predicate===ic||b.predicate===Sr));return g?{name:h,polarity:g.predicate===Sr?"negative":"positive",fact:g}:{name:h,polarity:"unknown",fact:null}},p=u.map(d),{typeEdges:f,subClassSucc:m}=ww(i);return{klass:l,kinds:u.length,positive:p.filter(h=>h.polarity==="positive"),negative:p.filter(h=>h.polarity==="negative"),unknown:p.filter(h=>h.polarity==="unknown"),chain:yw(o,l,f,m,s)}}function Bd(e,t,{exclude:n=[],maxHops:s=3}={}){let o=jr(e),r=jr(n),i=Array.isArray(t)?t:[],a=new Set,c=[];for(let l of i)l.predicate!==ic||!o.has(l.object)||r.has(l.subject)||a.has(l.subject)||(a.add(l.subject),ac(new Set([l.subject]),o,i,{maxHops:s}).verdict==="yes"&&c.push(l));return c.sort(PA)}var Er,Dd,rc,hw,LA,bw,ic,Sr,zd,PA,jr,ww,cc=M(()=>{It();Er="mgxneg:",Dd="mgx:",rc="mgxneg:subClassOf",hw=new Map([[Be,rc]]),LA=new Map([...hw].map(([e,t])=>[t,e]));bw=e=>String(e||"").startsWith(Er),ic="mgx:capableOf",Sr=kr(ic),zd=6,PA=(e,t)=>(t.trust||0)-(e.trust||0)||String(e.subject).localeCompare(String(t.subject)),jr=e=>e instanceof Set?e:new Set(Array.isArray(e)?e:[e]),ww=e=>{let t=e.filter(s=>s.predicate===Dt).map(s=>[s.subject,s.object]),n=e.filter(s=>s.predicate===Be).map(s=>[s.subject,s.object]);return{typeEdges:t,subClassSucc:oc(n)}}});function lc(e){let t=String(e||"");return Vd.has(t)?Wd:FA.has(t)||DA.test(t)?Si:zA.has(t)?$w:Gd}function UA(e){let t=e?.observedAt;if(t&&Number.isFinite(Date.parse(t)))return String(t);if(hh.has(e?.sourceType)){for(let n of[e?.assertedAt,e?.createdAt])if(n&&Number.isFinite(Date.parse(n)))return String(n)}}function BA(e,t){let n=null;for(let s of e?.assertions||[]){let o=Date.parse(UA(s)??"");Number.isFinite(o)&&(n===null||(t?o<n:o>n))&&(n=o)}return n}function Hd(e,t){let n=t===$w;if(!n&&t!==Si)return null;let s=(e||[]).map(r=>({row:r,at:BA(r,n)}));s.sort((r,i)=>{if(r.at!==i.at)return r.at===null?1:i.at===null?-1:n?r.at-i.at:i.at-r.at;let a=(i.row.trust||0)-(r.row.trust||0);if(a)return a;let[c,l]=[String(r.row.object),String(i.row.object)];return c<l?-1:c>l?1:0});let o=s.map(r=>r.row);return{winner:o[0]||null,ranked:o,contested:s.length>1&&s[0].at===s[1].at}}var Wd,Si,$w,Gd,MA,Vd,FA,DA,zA,vw=M(()=>{cc();Mn();Wd="merge",Si="latest-observation-wins",$w="first-claim-wins",Gd="contradiction",MA=["mgx:hasA","mgx:capableOf","rdfs:subClassOf","rdf:type","owl:disjointWith","mgx:partOf","mgx:memberOf","mgx:collectionOf","mgx:usedFor","mgx:receivesAction","mgx:causes","mgx:causesDesire","mgx:hasSubevent","mgx:hasPrerequisite","mgx:motivatedByGoal","mgx:obstructedBy","mgx:desires","mgx:hasProperty","mgx:madeOf","mgx:atLocation","mgx:locatedNear","mgx:createdBy","mgx:mannerOf","mgx:relatedTo","mgx:synonym","mgx:antonym","mgx:similarTo","mgx:symbolOf","mgx:knows-about"],Vd=new Set(MA.flatMap(e=>[e,kr(e)])),FA=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:hidden-in","mgx:on-top-of","mgx:on-plane","mgx:under","mgx:is-open","mgx:hasMass","mgx:feels","mgx:faces","mgx:pose","mgx:display-name","mgx:nodeName","mgx:worldName"]),DA=/^mgx:has-exit-([a-z]+)$/,zA=new Set(["mgx:playedBy"])});function Ri(e){let t=String(e||""),n=t.indexOf(uc);return n<0?"":t.slice(n+uc.length)}function qA(e){let t=1,n=0;for(let s of e)t*=1-VA(s),n+=1;return n?HA(Math.min(1,1-t)):0}function kw(e,t,n){let s=Date.parse(e),o=Date.parse(t);return Number.isFinite(s)?Number.isFinite(o)?n(s,o)===s?String(e):String(t):String(e):Number.isFinite(o)?String(t):""}function Tw(e,t){let n=Date.parse(e.assertedAt),s=Date.parse(t.assertedAt),o=Number.isFinite(n)?n:-1/0,r=Number.isFinite(s)?s:-1/0;return o!==r?r-o:e.id<t.id?-1:e.id>t.id?1:0}function Aw(e,t="",n=""){let s=t,o=n;for(let r of e)s=Rw(s,r.assertedAt),o=_w(o,r.assertedAt);return{earliest:s,latest:o}}function Xd({id:e,sourceKey:t,template:n,idsProp:s,ids:o,earliest:r,latest:i,priorFor:a}){let c=[...new Set(o)].filter(Boolean).sort(),l=a?qA(c.map(u=>a(u))):void 0;return{id:e,label:n?.label||"",class:WA,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"rdf:Statement"},{prop:"rdf:subject",key:"subject",value:n?.subject||""},{prop:"rdf:predicate",key:"predicate",value:n?.predicate||""},{prop:"rdf:object",key:"object",value:n?.object||""},{prop:"mgx:createdAt",key:"createdAt",value:r},{prop:"mgx:sourceId",key:"sourceId",value:t},{prop:s,key:s===Rr?"rollupSourceIds":"rollupRecordIds",value:c.join(" ")},{prop:ki,key:"rollupCount",value:String(c.length)},{prop:ts,key:"rollupEarliest",value:r},{prop:ns,key:"rollupLatest",value:i},...l===void 0?[]:[{prop:_r,key:"rollupPrior",value:String(l)}]]}}function Cw({groupId:e,sourceType:t,heads:n=[],existing:s=null,priorFor:o}){if(!e||!t||n.length<64||n.length<=8)return null;let i=n.slice().sort(Tw).slice(8);if(!i.length)return null;let{earliest:a,latest:c}=Aw(i,zt(s,ts),zt(s,ns));return{rollup:Xd({id:qd(e,t),sourceKey:`rollup:${t}`,template:Jd(i[0].record||s),idsProp:Rr,ids:[...pc(s),...i.map(u=>u.sourceId)],earliest:a,latest:c,priorFor:o}),absorbed:i.map(u=>u.id),absorbedSourceIds:i.map(u=>u.sourceId)}}function Iw({groupId:e,sourceId:t,leaves:n=[],existing:s=null}){if(!e||!t||n.length<8||n.length<=2)return null;let o=n.slice().sort(Tw),r=o.slice(0,2),i=o.slice(2);if(!i.length)return null;let{earliest:a,latest:c}=Aw(i,zt(s,ts),zt(s,ns));return{rollup:Xd({id:Kd(e,t),sourceKey:t,template:Jd(i[0].record||s),idsProp:ji,ids:[...GA(s),...i.map(u=>u.id)],earliest:a,latest:c}),absorbed:i.map(u=>u.id),rewire:r[r.length-1]?.id||""}}function Qd(e,t,{priorFor:n}={}){let s=e?.id||t?.id,o=so(s),r=o?Rr:ji,i=a=>Yd(zt(a,r));return Xd({id:s,sourceKey:zt(e,"mgx:sourceId")||zt(t,"mgx:sourceId"),template:Jd(zt(e,"rdf:subject")?e:t),idsProp:r,ids:[...i(e),...i(t)],earliest:Rw(zt(e,ts),zt(t,ts)),latest:_w(zt(e,ns),zt(t,ns)),priorFor:o?n:void 0})}function Ow(e,t){if(!t)return!1;for(let n of e||[])if(pc(n).includes(t))return!0;return!1}var WA,xw,Ew,dc,Sw,Rr,ji,ki,ts,ns,_r,uc,jw,qd,Kd,so,Tr,fc,zt,Yd,pc,GA,VA,HA,Rw,_w,Jd,Zd=M(()=>{WA="Fact",xw=64,Ew=8,dc=8,Sw=2,Rr="mgx:rollupSourceIds",ji="mgx:rollupRecordIds",ki="mgx:rollupCount",ts="mgx:rollupEarliest",ns="mgx:rollupLatest",_r="mgx:rollupPrior",uc="@rollup:",jw="#rollup",qd=(e,t)=>`${e}${uc}${t}`,Kd=(e,t)=>`${e}@${t}${jw}`,so=e=>String(e||"").includes(uc),Tr=e=>String(e||"").endsWith(jw),fc=e=>so(e)||Tr(e);zt=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",Yd=e=>String(e||"").split(" ").filter(Boolean),pc=e=>Yd(zt(e,Rr)),GA=e=>Yd(zt(e,ji)),VA=e=>Math.max(0,Math.min(1,Number(e)||0)),HA=e=>Number(e.toFixed(6));Rw=(e,t)=>kw(e,t,Math.min),_w=(e,t)=>kw(e,t,Math.max);Jd=e=>({label:e?.label||"",subject:zt(e,"rdf:subject"),predicate:zt(e,"rdf:predicate"),object:zt(e,"rdf:object")})});function sf(e){let t=String(e||"");return nf(t)?t.slice(0,-bc.length):""}function Nw(e,t){let n=Date.parse(e),s=Date.parse(t);return Number.isFinite(n)?Number.isFinite(s)&&s>n?String(t):String(e):Number.isFinite(s)?String(t):""}function of({id:e,sourceId:t,template:n,ids:s,retractedAt:o,tags:r}){let i=[...new Set(s)].filter(Boolean).sort(),a=[...new Set(r)].filter(Boolean).sort();return{id:e,label:n?.label||"",class:bn,derived_from:[],mentions:[],attributes:[{prop:"rdf:subject",key:"subject",value:n?.subject||""},{prop:"rdf:predicate",key:"predicate",value:n?.predicate||""},{prop:"rdf:object",key:"object",value:n?.object||""},{prop:"mgx:sourceId",key:"sourceId",value:t||""},{prop:hc,key:"retractedRecordIds",value:i.join(" ")},{prop:ef,key:"retractedCount",value:String(i.length)},{prop:gc,key:"retractedAt",value:o||""},...a.length?[{prop:_i,key:"provenance",value:a.join(" | ")}]:[]]}}function Pw({groupId:e,sourceId:t,recordIds:n=[],retractedAt:s="",existing:o=null,template:r=null,provenance:i=""}){if(!e||!t)return null;let a=[...No(o),...n].filter(Boolean);return a.length?of({id:tf(e,t),sourceId:t,template:r||Lw(o),ids:a,retractedAt:Nw(Lo(o),s),tags:[...Ti(Rn(o,_i)),...Ti(i)]}):null}function Mw(e,t){let n=Lw(Rn(e,"rdf:subject")?e:t);return of({id:e?.id||t?.id,sourceId:Rn(e,"mgx:sourceId")||Rn(t,"mgx:sourceId"),template:n,ids:[...No(e),...No(t)],retractedAt:Nw(Lo(e),Lo(t)),tags:[...Ti(Rn(e,_i)),...Ti(Rn(t,_i))]})}function YA(e,t){let n=Date.parse(e),s=Date.parse(t);return!Number.isFinite(s)||!Number.isFinite(n)?!0:n<=s}function XA(e,t,n=""){return!e||!t||!No(e).includes(t)?!1:YA(n,Lo(e))}function wc(e,t,n=""){for(let s of e||[])if(XA(s,t,n))return!0;return!1}function JA(e,t){let n=[...new Set(t||[])].filter(Boolean).sort();return[e||"-",...n].join(" ")}function QA(e){let t=String(e||"").split(" ").filter(Boolean),n=t[0]||"",s=n==="-"||!Number.isFinite(Date.parse(n))?"":n,o=s||n==="-"?t.slice(1):t;return{retractedAt:s,ids:o}}function yc(e){let t=sf(e?.id);return t?{id:e.id,subject:t,predicate:mc,object:JA(Lo(e),No(e)),provenance:Rn(e,_i)}:null}function $c(e){if(!e||e.predicate!==mc)return null;let t=String(e.subject||""),n=t.indexOf("@");if(n<=0||n===t.length-1)return null;let{retractedAt:s,ids:o}=QA(e.object);return o.length?of({id:`${t}${bc}`,sourceId:t.slice(n+1),template:null,ids:o,retractedAt:s,tags:Ti(e.provenance)}):null}var bn,mc,hc,gc,ef,bc,_i,tf,nf,Rn,KA,Ti,No,Lo,Lw,rf=M(()=>{bn="Retraction",mc="mgx:retracted",hc="mgx:retractedRecordIds",gc="mgx:retractedAt",ef="mgx:retractedCount",bc="#retracted",_i="mgx:factProvenance",tf=(e,t)=>`${e}@${t}${bc}`,nf=e=>String(e||"").endsWith(bc);Rn=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",KA=e=>String(e||"").split(" ").filter(Boolean),Ti=e=>String(e||"").split(" | ").filter(Boolean),No=e=>KA(Rn(e,hc)),Lo=e=>Rn(e,gc);Lw=e=>({label:e?.label||"",subject:Rn(e,"rdf:subject"),predicate:Rn(e,"rdf:predicate"),object:Rn(e,"rdf:object")})});var ZA,eC,tC,nC,af,dU,Fw=M(()=>{Mn();ZA="mgx:worldName",eC="mgx:nodeName",tC="mgx:playedBy",nC="mgx:waved",af="mgx:invitedBy",dU=Object.freeze([ZA,eC,tC,nC,af])});function vc(e){let t=new Set;for(let n of e||[])n?.predicate===af&&(n.subject&&t.add(String(n.subject)),n.object&&t.add(String(n.object)));return[...t].sort()}function cf(e,t=""){let n=String(t||"");return(e||[]).map(String).filter(s=>s&&s!==n)}function xc({recordIds:e=[],roster:t=[],self:n="",acknowledgedBy:s=null}={}){let o=cf(t,n);if(!o.length)return[];if(typeof s!="function")return[];let r=new Map;for(let a of o){let c=s(a);r.set(a,new Set([...c||[]].map(String)))}return[...new Set((e||[]).map(String).filter(Boolean))].sort().filter(a=>o.every(c=>r.get(c).has(a)))}var lf=M(()=>{Fw()});function Is(e,t){let n=(e?.attributes||[]).find(s=>s?.prop===t);return n?String(n.value??""):void 0}function cC(e,t){(!e?.class||!sC.has(e.class))&&t.push(`must have a class from the closed vocabulary Utterance | Fact | Session | Source | Rule (got ${JSON.stringify(e?.class)})`)}function lC(e,t){for(let i of["rdf:subject","rdf:predicate","rdf:object"])Ai(Is(e,i))||t.push(`a Fact needs a non-empty ${i}`);for(let i of["rdf:subject","rdf:object"]){let a=Is(e,i);a!==void 0&&rC.test(a)&&t.push(`a Fact's ${i} must be a single term, not text spanning a sentence boundary (got ${JSON.stringify(a)})`)}let n=Is(e,"mgx:factProvenance");n!==void 0&&!Ai(n)&&t.push("mgx:factProvenance, when present, must be non-empty");let s=typeof e?.id=="string"?e.id:"";iC(s)&&!zw.test(s)&&t.push(`a Fact record id must read <groupId>@<sourceId>, optionally suffixed #v<n> once superseded (got ${JSON.stringify(s)})`);let o=Is(e,"mgx:sourceId");o!==void 0&&!Ai(o)&&t.push("mgx:sourceId, when present, must be non-empty (every assertion record has a key, src:none included)");let r=Is(e,"mgx:observedAt");r!==void 0&&!Number.isFinite(Date.parse(r))&&t.push(`mgx:observedAt, when present, must be a parseable instant (got ${JSON.stringify(r)})`);for(let i of aC){let a=Is(e,i);if(a===void 0)continue;let c=a.split(" ").filter(Boolean);c.length||t.push(`${i}, when present, must name at least one record id`);for(let l of c)zw.test(l)||t.push(`${i} must name Fact record ids (got ${JSON.stringify(l)})`)}}function uC(e,t){Ai(Is(e,"mgx:ruleName"))||t.push("a Rule needs a non-empty mgx:ruleName");let n=Is(e,"mgx:ruleKind");if(!n||!Dw.has(n)){t.push(`a Rule's mgx:ruleKind must be one of ${[...Dw].join(" | ")} (got ${JSON.stringify(n)})`);return}for(let s of oC[n])Ai(Is(e,s))||t.push(`a ${n} Rule needs a non-empty ${s}`)}function dC(e){let t=[];return cC(e,t),e?.class==="Fact"&&lC(e,t),e?.class==="Rule"&&uC(e,t),{ok:t.length===0,violations:t}}function uf(e){let t=dC(e);if(!t.ok){let n=new Error(`SHACL validation failed for ${e?.class} "${e?.id}": ${t.violations.join(" | ")}`);throw n.violations=t.violations,n}}var sC,Dw,oC,rC,zw,iC,aC,Ai,Uw=M(()=>{sC=new Set(["Utterance","Fact","Session","Source","Rule"]),Dw=new Set(["compose2","filter","recursive","action-signature","action-precond","action-effect","action-constraint"]),oC={compose2:["mgx:ruleBase1","mgx:ruleBase2"],filter:["mgx:ruleBase1","mgx:ruleFilterProperty"],recursive:["mgx:ruleBaseCase","mgx:ruleRecStep"],"action-signature":["mgx:ruleActionSubjectClass","mgx:ruleActionTargetClass"],"action-precond":["mgx:ruleActionPrecondShape","mgx:ruleActionPrecondPredicate","mgx:ruleActionPrecondRole","mgx:ruleActionPrecondScope"],"action-effect":["mgx:ruleActionEffectPredicate","mgx:ruleActionEffectSubject"],"action-constraint":["mgx:ruleActionConstraintLeft","mgx:ruleActionConstraintRight","mgx:ruleActionConstraintGuard"]},rC=/[.!?]\s+\w/,zw=/^[^@]+@(.+?)(#v[1-9][0-9]*)?$/,iC=e=>e.includes("@")||/#v\d/.test(e),aC=["mgx:supersedes","mgx:supersededBy"];Ai=e=>typeof e=="string"&&e.trim().length>0});var Bw={};Nt(Bw,{access:()=>mC,appendFile:()=>bC,basename:()=>OC,copyFile:()=>SC,createInterface:()=>FC,createReadStream:()=>kC,createRequire:()=>fC,createWriteStream:()=>RC,default:()=>zC,dirname:()=>AC,existsSync:()=>_C,fileURLToPath:()=>LC,isAbsolute:()=>IC,join:()=>TC,mkdir:()=>wC,mkdtemp:()=>yC,randomBytes:()=>PC,readFile:()=>hC,readFileSync:()=>pC,readdir:()=>jC,rename:()=>$C,resolve:()=>CC,rm:()=>xC,sep:()=>NC,spawnSync:()=>MC,stat:()=>EC,tmpdir:()=>DC,unlink:()=>vC,writeFile:()=>gC});var xt,fC,pC,mC,hC,gC,bC,wC,yC,$C,vC,xC,EC,SC,jC,kC,RC,_C,TC,AC,CC,IC,OC,NC,LC,PC,MC,FC,DC,zC,Ww=M(()=>{xt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},fC=xt("createRequire"),pC=xt("readFileSync"),mC=xt("access"),hC=xt("readFile"),gC=xt("writeFile"),bC=xt("appendFile"),wC=xt("mkdir"),yC=xt("mkdtemp"),$C=xt("rename"),vC=xt("unlink"),xC=xt("rm"),EC=xt("stat"),SC=xt("copyFile"),jC=xt("readdir"),kC=xt("createReadStream"),RC=xt("createWriteStream"),_C=()=>!1,TC=(...e)=>e.join("/"),AC=e=>String(e).replace(/\/[^/]*$/,""),CC=(...e)=>e.join("/"),IC=e=>String(e).startsWith("/"),OC=e=>String(e).split("/").pop(),NC="/",LC=e=>String(e),PC=xt("randomBytes"),MC=xt("spawnSync"),FC=xt("createInterface"),DC=()=>"/tmp",zC={}});var UC,Ci,df=M(()=>{UC=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,Ci=class e extends Date{#t=!1;#n=!1;#e=null;constructor(t){let n=!0,s=!0,o="Z";if(typeof t=="string"){let r=t.match(UC);r?(r[1]||(n=!1,t=`0000-01-01T${t}`),s=!!r[2],s&&t[10]===" "&&(t=t.replace(" ","T")),r[2]&&+r[2]>23?t="":(o=r[3]||null,t=t.toUpperCase(),!o&&s&&(t+="Z"))):t=""}super(t),isNaN(this.getTime())||(this.#t=n,this.#n=s,this.#e=o)}isDateTime(){return this.#t&&this.#n}isLocal(){return!this.#t||!this.#n||!this.#e}isDate(){return this.#t&&!this.#n}isTime(){return this.#n&&!this.#t}isValid(){return this.#t||this.#n}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(this.#e===null)return t.slice(0,-1);if(this.#e==="Z")return t;let n=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return n=this.#e[0]==="-"?n:-n,new Date(this.getTime()-n*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(t,n="Z"){let s=new e(t);return s.#e=n,s}static wrapAsLocalDateTime(t){let n=new e(t);return n.#e=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#n=!1,n.#e=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#t=!1,n.#e=null,n}}});function BC(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function WC(e,t,n){let s=e.split(/\r\n|\n|\r/g),o="",r=(Math.log10(t+1)|0)+1;for(let i=t-1;i<=t+1;i++){let a=s[i-1];a&&(o+=i.toString().padEnd(r," "),o+=": ",o+=a,o+=`
85
+ `),tier:g,topup:y}}async function kd(e,{config:t,source:n,tel:s}){return(await ew(e,{config:t,source:n,tel:s})).text}var Rd=M(()=>{Pt();Je();Kt();ec();ni();De();Jn();sc();oc();tt();kd.ownsGraphLoad=!0});function tw(e,{graph:t,svc:n}){let{match:s}=Ft(n,ft(e,"symbol"),"symbol");return bg(fr(t,s))}var nw=M(()=>{De();tt()});function rc(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function Si(e){return rc(e).toString(16).padStart(8,"0")}function _d(e){let t=new TextEncoder().encode(String(e)),n=t.length*8,s=new Uint8Array((t.length+8>>6)+1<<6);s.set(t),s[t.length]=128;let o=new DataView(s.buffer);o.setUint32(s.length-8,Math.floor(n/4294967296)),o.setUint32(s.length-4,n>>>0);let r=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint32Array(64),a=(u,d)=>u>>>d|u<<32-d;for(let u=0;u<s.length;u+=64){for(let $=0;$<16;$+=1)i[$]=o.getUint32(u+$*4);for(let $=16;$<64;$+=1){let E=a(i[$-15],7)^a(i[$-15],18)^i[$-15]>>>3,_=a(i[$-2],17)^a(i[$-2],19)^i[$-2]>>>10;i[$]=i[$-16]+E+i[$-7]+_>>>0}let[d,p,f,m,h,g,b,y]=r;for(let $=0;$<64;$+=1){let E=a(h,6)^a(h,11)^a(h,25),_=h&g^~h&b,v=y+E+_+_A[$]+i[$]>>>0,S=a(d,2)^a(d,13)^a(d,22),C=d&p^d&f^p&f,x=S+C>>>0;y=b,b=g,g=h,h=m+v>>>0,m=f,f=p,p=d,d=v+x>>>0}r[0]=r[0]+d>>>0,r[1]=r[1]+p>>>0,r[2]=r[2]+f>>>0,r[3]=r[3]+m>>>0,r[4]=r[4]+h>>>0,r[5]=r[5]+g>>>0,r[6]=r[6]+b>>>0,r[7]=r[7]+y>>>0}let c=new Uint8Array(32),l=new DataView(c.buffer);for(let u=0;u<8;u+=1)l.setUint32(u*4,r[u]);return c}function TA(e,t){let n=_d(e),s="";for(let o=0;o<t;o+=1)s+=n[o].toString(16).padStart(2,"0");return s}function q(e){let t=As(e);return t=t.replace(/^\/c\/[a-z]{2,3}\//i,""),t=t.replace(/^[a-z][\w.-]*:/i,""),t=t.replace(/_/g," ").replace(/\s+/g," ").trim(),t=t.replace(/^(?:the|an?)\s+/i,""),t.toLowerCase()}function Zn(e){let t=As(e);return CA.get(t)??t}function ve(e,t,n){return Io(q(e),Zn(t),q(n))}var _A,AA,As,CA,Io,it=M(()=>{_A=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);AA=2e3,As=e=>String(e??"").replace(/\s+/g," ").trim().slice(0,AA);CA=new Map([["mgx:cause","mgx:causes"],["mgx:desire","mgx:desires"],["mgx:want","mgx:desires"],["mgx:require","mgx:hasPrerequisite"],["mgx:involve","mgx:hasSubevent"],["mgx:used-for","mgx:usedFor"],["mgx:made-of","mgx:madeOf"]]);Io=(e,t,n)=>`fact:${TA(`${e}\0${t}\0${n}`,8)}`});var an={};Lt(an,{CARDINALITY_RULE_CONFIDENCE:()=>MA,CAX_DW_RULE:()=>Ad,CAX_DW_RULE_CONFIDENCE:()=>Id,CAX_MAXC0_RULE_CONFIDENCE:()=>DA,CLS_SVF1_RULE:()=>Od,CLS_SVF1_RULE_CONFIDENCE:()=>Ld,DEFAULT_MAX_ENVIRONMENTS:()=>xr,DISJOINT_PREDICATE:()=>$r,ENTAILED_DISJOINT_PROVENANCE:()=>Cd,ENTAILED_PROVENANCE:()=>rw,ENTAILED_SCM_SVF_PROVENANCE:()=>Dd,ENTAILED_SVF1_PROVENANCE:()=>Nd,ENTAILED_TYPE_PROVENANCE:()=>aw,ON_PROPERTY_PREDICATE:()=>Rn,SCM_SVF_RULE:()=>Fd,SCM_SVF_RULE_CONFIDENCE:()=>zd,SOME_VALUES_FROM_PREDICATE:()=>_n,SUBCLASS_PREDICATE:()=>Be,TYPE_PREDICATE:()=>Dt,buildCardinalityRestrictions:()=>Md,buildRelevanceFrontier:()=>Td,buildSubClassSuccessors:()=>ic,deriveDisjointViolations:()=>dw,deriveSomeValuesFromApplication:()=>fw,deriveSomeValuesFromSubsumption:()=>pw,deriveSubClassClosure:()=>cw,deriveSubClassClosureDelta:()=>lw,deriveTypePropagation:()=>uw,entailedTrustFrom:()=>OA,findConsistencyViolations:()=>UA,findIsaChain:()=>Ud,proveCardinalityAtLeast:()=>FA,proveMaxCardinalityZeroDenial:()=>zA,retractSubClassOf:()=>VA,syllogise:()=>hw});function sw(e,t,n){for(let s of t)if(typeof e?.[s]!="function")throw new TypeError(`${n} needs a store option carrying { ${t.join(", ")} } (memory/core.mjs's read/write functions) \u2014 missing ${s}`);return e}function OA(e,t=1){let n=(Array.isArray(e)?e:[]).filter(o=>typeof o=="number");if(!n.length)return null;let s=Math.max(0,Math.min(1,Math.min(...n)*t));return Number(s.toFixed(6))}function Cs(e){if(!e)return null;let t=e instanceof Set?[...e]:Array.isArray(e)?e:[],n=new Set;for(let s of t){let o=q(s);o&&n.add(o)}return n.size?n:null}function cw(e,{depth:t=32,budget:n=50,focus:s=null}={}){let o=new Set,r=new Map;for(let[u,d]of e||[])!u||!d||u===d||(o.add(`${u}${We}${d}`),r.has(u)||r.set(u,new Set),r.get(u).add(d));let i=s instanceof Set?s.size?s:null:Cs(s),a=(u,d,p)=>!i||i.has(u)||i.has(d)||i.has(p),c=[],l=new Set;for(let u=0;u<t;u+=1){let d=[];for(let[f,m]of r)for(let h of m){let g=r.get(h);if(g)for(let b of g){if(f===b)continue;let y=`${f}${We}${b}`;o.has(y)||l.has(y)||a(f,h,b)&&d.push([f,h,b,y])}}if(!d.length)break;d.sort((f,m)=>f[0].localeCompare(m[0])||f[2].localeCompare(m[2])||f[1].localeCompare(m[1]));let p=!1;for(let[f,m,h,g]of d)if(!l.has(g)){if(c.length>=n)break;l.add(g),c.push({subject:f,object:h,via:m}),r.has(f)||r.set(f,new Set),r.get(f).add(h),p=!0}if(c.length>=n||!p)break}return c}function lw(e,t,{depth:n=32,budget:s=50,focus:o=null}={}){let r=new Set,i=new Map,a=new Map;for(let[m,h]of e||[])!m||!h||m===h||(r.add(`${m}${We}${h}`),i.has(m)||i.set(m,new Set),i.get(m).add(h),a.has(h)||a.set(h,new Set),a.get(h).add(m));let c=[],l=new Set;for(let[m,h]of t||[]){if(!m||!h||m===h)continue;let g=`${m}${We}${h}`;l.has(g)||(l.add(g),c.push([m,h]))}let u=o instanceof Set?o.size?o:null:Cs(o),d=(m,h,g)=>!u||u.has(m)||u.has(h)||u.has(g),p=[],f=new Set;for(let m=0;m<n&&c.length;m+=1){let h=[],g=($,E,_)=>{if($===_)return;let v=`${$}${We}${_}`;r.has(v)||f.has(v)||d($,E,_)&&h.push([$,E,_,v])};for(let[$,E]of c){for(let _ of i.get(E)||[])g($,E,_);for(let _ of a.get($)||[])g(_,$,E)}if(!h.length)break;h.sort(($,E)=>$[0].localeCompare(E[0])||$[2].localeCompare(E[2])||$[1].localeCompare(E[1]));let b=!1,y=[];for(let[$,E,_,v]of h)if(!f.has(v)){if(p.length>=s)break;f.add(v),p.push({subject:$,object:_,via:E}),i.has($)||i.set($,new Set),i.get($).add(_),a.has(_)||a.set(_,new Set),a.get(_).add($),y.push([$,_]),b=!0}if(p.length>=s||!b)break;c=y}return p}function es(e){let t=new Map;for(let[s,o]of e||[])!s||!o||s===o||(t.has(s)||t.set(s,new Set),t.get(s).add(o));let n=new Map;return s=>{if(n.has(s))return n.get(s);let o=new Set,r=[...t.get(s)||[]];for(;r.length;){let i=r.pop();if(!o.has(i)){o.add(i);for(let a of t.get(i)||[])o.has(a)||r.push(a)}}return n.set(s,o),o}}function NA(e){return es((e||[]).map(([t,n])=>[n,t]))}function Td(e,t){let n=[],s=[],o=new Map,r=new Map;for(let l of e||[])!l||!l.subject||!l.predicate||!l.object||(so(l.predicate)?n.push([l.subject,l.object]):No(l.predicate)?s.push([l.subject,l.object]):vr(l.predicate)?o.set(l.subject,l.object):ki(l.predicate)&&r.set(l.subject,l.object));let i=NA(n),a=new Set;for(let l of t||[]){let u=q(l);if(u){a.add(u);for(let d of i(u))a.add(d)}}let c=new Set(a);for(let[l,u]of s)a.has(u)&&c.add(l);for(let[l,u]of r)o.has(l)&&a.has(u)&&c.add(l);return c}function uw(e,t,{budget:n=50,focus:s=null,presentTypeEdges:o=e}={}){let r=es(t),i=new Set,a=new Set;for(let[f,m]of o||[])f&&m&&i.add(`${f}${We}${m}`);let c=s instanceof Set?s.size?s:null:Cs(s),l=(f,m,h)=>!c||c.has(f)||c.has(m)||c.has(h),u=[];for(let[f,m]of e||[]){if(!f||!m)continue;let h=`${f}${We}${m}`;if(!a.has(h)){a.add(h);for(let g of r(m)){if(g===m||g===f)continue;let b=`${f}${We}${g}`;i.has(b)||l(f,m,g)&&u.push([f,m,g,b])}}}u.sort((f,m)=>f[0].localeCompare(m[0])||f[2].localeCompare(m[2])||f[1].localeCompare(m[1]));let d=[],p=new Set;for(let[f,m,h,g]of u)if(!p.has(g)){if(d.length>=n)break;p.add(g),d.push({subject:f,object:h,via:m})}return d}function dw(e,t,n,{budget:s=50,focus:o=null}={}){let r=es(t),i=new Map,a=new Set;for(let[m,h]of n||[])!m||!h||m===h||(a.add(`${m}${We}${h}`),a.add(`${h}${We}${m}`),i.has(m)||i.set(m,new Set),i.get(m).add(h),i.has(h)||i.set(h,new Set),i.get(h).add(m));if(!i.size)return[];let c=new Set,l=o instanceof Set?o.size?o:null:Cs(o),u=(m,h,g)=>!l||l.has(m)||l.has(h)||l.has(g),d=[];for(let[m,h]of e||[]){if(!m||!h)continue;let g=`${m}${We}${h}`;if(!c.has(g)){c.add(g);for(let b of[h,...r(h)]){let y=i.get(b);if(y)for(let $ of y){if($===m)continue;let E=`${m}${We}${$}`;a.has(E)||u(m,h,$)&&d.push([m,h,b,$,E])}}}}d.sort((m,h)=>m[0].localeCompare(h[0])||m[3].localeCompare(h[3])||m[2].localeCompare(h[2])||m[1].localeCompare(h[1]));let p=[],f=new Set;for(let[m,h,g,b,y]of d)if(!f.has(y)){if(p.length>=s)break;f.add(y),p.push({subject:m,object:b,viaType:h,viaClass:g})}return p}function fw(e,t,n,s,{budget:o=50,focus:r=null}={}){let i=es(n),a=new Map;for(let g of s||[]){if(!g||!g.restriction||!g.property||!g.target)continue;let b=`${g.property}${We}${g.target}`;a.has(b)||a.set(b,new Set),a.get(b).add(g.restriction)}if(!a.size)return[];let c=new Set,l=new Map;for(let[g,b]of t||[])!g||!b||(c.add(`${g}${We}${b}`),l.has(g)||l.set(g,new Set),l.get(g).add(b));let u=r instanceof Set?r.size?r:null:Cs(r),d=(g,b,y)=>!u||u.has(g)||u.has(b)||u.has(y),p=new Set,f=[];for(let[g,b,y]of e||[]){if(!g||!b||!y)continue;let $=q(b),E=`${g}${We}${$}${We}${y}`;if(p.has(E))continue;p.add(E);let _=l.get(y);if(_)for(let v of _)for(let S of[v,...i(v)]){let C=a.get(`${$}${We}${S}`);if(C)for(let x of C){if(g===x)continue;let R=`${g}${We}${x}`;c.has(R)||d(g,y,x)&&f.push([g,b,$,y,v,S,x,R])}}}f.sort((g,b)=>g[0].localeCompare(b[0])||g[6].localeCompare(b[6])||g[1].localeCompare(b[1])||g[3].localeCompare(b[3]));let m=[],h=new Set;for(let[g,b,y,$,E,_,v,S]of f)if(!h.has(S)){if(m.length>=o)break;h.add(S),m.push({subject:g,object:v,viaProperty:b,viaPropertyKey:y,viaValue:$,viaType:E,viaTarget:_})}return m}function Md(e){let t=new Map,n=new Map,s=new Map;for(let r of e||[])if(!(!r||!r.subject||!r.predicate))if(vr(r.predicate))t.set(r.subject,r.object);else if(IA(r.predicate))s.set(r.subject,r.object);else{let i=PA[String(r.predicate).trim().toLowerCase()];if(!i)continue;let a=Number(r.object);Number.isFinite(a)&&n.set(r.subject,{kind:i,n:a})}let o=[];for(let[r,{kind:i,n:a}]of n){if(t.get(r)!==LA)continue;let c=s.get(r);c&&o.push({restriction:r,kind:i,n:a,onClass:c})}return o.sort((r,i)=>r.restriction.localeCompare(i.restriction)),o}function pw(e,t,{budget:n=50,focus:s=null}={}){let o=es(t),r=new Map;for(let p of e||[]){if(!p||!p.restriction||!p.property||!p.target)continue;let f=q(p.property);r.has(f)||r.set(f,[]),r.get(f).push({restriction:p.restriction,target:p.target})}let i=new Set;for(let[p,f]of t||[])p&&f&&i.add(`${p}${We}${f}`);let a=s instanceof Set?s.size?s:null:Cs(s),c=(p,f)=>!a||a.has(p)||a.has(f),l=[];for(let[,p]of r)if(!(p.length<2))for(let f of p)for(let m of p){if(f.restriction===m.restriction||f.target===m.target||!o(f.target).has(m.target))continue;let h=`${f.restriction}${We}${m.restriction}`;i.has(h)||c(f.restriction,m.restriction)&&l.push([f.restriction,m.restriction,f.target,m.target,h])}l.sort((p,f)=>p[0].localeCompare(f[0])||p[1].localeCompare(f[1]));let u=[],d=new Set;for(let[p,f,m,h,g]of l)if(!d.has(g)){if(u.length>=n)break;d.add(g),u.push({subject:p,object:f,viaY1:m,viaY2:h})}return u}function mw(e,t,n,s,{budget:o=20,focus:r=null}={}){if(!n)return null;let i=es(e),a=r instanceof Set?r.size?r:null:Cs(r),c=p=>!a||a.has(n)||a.has(p),l=new Map;for(let[p,f]of e||[])!p||!f||(l.has(p)||l.set(p,new Set),l.get(p).add(f));let u=new Map((t||[]).map(p=>[p.restriction,p])),d=0;for(let p of[n,...i(n)]){if(d>=o)break;if(d+=1,!!c(p))for(let f of l.get(p)||[]){let m=u.get(f);if(m&&s(m))return{viaClass:p,viaRestriction:f,record:m}}}return null}function FA(e,t,n,s,o,r={}){if(!s||!Number.isFinite(o))return null;let i=mw(e,t,n,a=>a.onClass===s&&(a.kind==="exactly"||a.kind==="min")&&a.n>=o,r);return i?{subject:n,object:s,m:o,n:i.record.n,kind:i.record.kind,viaClass:i.viaClass,viaRestriction:i.viaRestriction}:null}function zA(e,t,n,s,o={}){if(!s)return null;let r=mw(e,t,n,i=>i.onClass===s&&i.kind==="max"&&i.n===0,o);return r?{subject:n,object:s,viaClass:r.viaClass,viaRestriction:r.viaRestriction}:null}function UA(e,t,n,{budget:s=50,focus:o=null}={}){let r=es(t),i=new Map;for(let[f,m]of n||[])!f||!m||f===m||(i.has(f)||i.set(f,new Set),i.get(f).add(m),i.has(m)||i.set(m,new Set),i.get(m).add(f));if(!i.size)return[];let a=new Map;for(let[f,m]of e||[])!f||!m||(a.has(f)||a.set(f,new Set),a.get(f).add(m));let c=o instanceof Set?o.size?o:null:Cs(o),l=f=>!c||c.has(f),u=[],d=new Set;for(let[f,m]of a){if(!l(f))continue;let h=[...m].sort();for(let g=0;g<h.length;g+=1)for(let b=g+1;b<h.length;b+=1){let[y,$]=[h[g],h[b]],E=[y,...r(y)],_=[$,...r($)],v=null;for(let C of E){let x=i.get(C);if(x){for(let R of _)if(x.has(R)){v=[C,R];break}if(v)break}}if(!v)continue;let S=`${f}${We}${y}${We}${$}`;d.has(S)||(d.add(S),u.push([f,y,$,v[0],v[1]]))}}u.sort((f,m)=>f[0].localeCompare(m[0])||f[1].localeCompare(m[1])||f[2].localeCompare(m[2]));let p=[];for(let[f,m,h,g,b]of u){if(p.length>=s)break;p.push({subject:f,classA:m,classB:h,viaA:g,viaB:b})}return p}async function hw(e,{depth:t=32,budget:n=50,focus:s=null,expandFocus:o=!1,maxEnvironments:r=xr,full:i=!1,store:a}={}){let{loadMemory:c,readFactRows:l,appendFacts:u}=sw(a,["loadMemory","readFactRows","appendFacts"],"syllogise"),d=typeof a?.loadSyllogiseState=="function"&&typeof a?.saveSyllogiseState=="function",p=await c(e),f=l(p),m=f.filter(A=>so(A.predicate)).map(A=>[A.subject,A.object]),h=f.filter(A=>No(A.predicate)).map(A=>[A.subject,A.object]),g=f.filter(A=>Oo(A.predicate)).map(A=>[A.subject,A.object]),b=new Map,y=new Map,$=[];for(let A of f){let he=String(A.predicate||"").trim().toLowerCase();vr(A.predicate)?b.set(A.subject,A.object):ki(A.predicate)?y.set(A.subject,A.object):Pd.has(he)||$.push([A.subject,A.predicate,A.object])}let E=[];for(let[A,he]of b){let Oe=y.get(A);Oe&&E.push({restriction:A,property:he,target:Oe})}let _=Cs(s),v=o&&_?Td(f,[..._]):_,S=v===null&&d?await a.loadSyllogiseState(e):null,C=new Set(f.map(A=>A.id)),x=Array.isArray(S?.factIds)?S.factIds.filter(A=>!C.has(A)):[],R=S&&Array.isArray(S.factIds)&&!x.length&&!i?"delta":"full",w=R==="delta"?new Set(S.factIds):null,T=R==="delta"?f.filter(A=>!w.has(A.id)):f,I=T.length,j=new Map;for(let A of f)j.set(`${A.subject}${We}${A.predicate}${We}${A.object}`,A.trust);let k=(A,he,Oe)=>j.get(`${A}${We}${he}${We}${Oe}`),P=(A,he,Oe)=>j.has(`${A}${We}${he}${We}${Oe}`),U=A=>A.filter(he=>typeof he=="number"),H=R==="delta"&&!T.length,X=R==="delta"?T.filter(A=>so(A.predicate)).map(A=>[A.subject,A.object]):[],Q=R==="delta"?X.length?lw(m,X,{depth:t,budget:n,focus:v}):[]:cw(m,{depth:t,budget:n,focus:v}),L=m.concat(Q.map(A=>[A.subject,A.object])),V=v,W=null;if(R==="delta"&&!H){let A=f.concat(Q.map(Oe=>({subject:Oe.subject,predicate:Be,object:Oe.object}))),he=[];for(let Oe of T)he.push(Oe.subject,Oe.object);W=Td(A,he),V=W}let O=A=>!W||W.has(A),D=W?h.filter(([A,he])=>O(A)||O(he)):h,N=new Set;if(W)for(let A of T)Oo(A.predicate)&&(N.add(A.subject),N.add(A.object));let F=W&&N.size?es(L):null,z=W?h.filter(([A,he])=>O(A)||O(he)||F&&[...F(he)].some(Oe=>N.has(Oe))):h,B=new Set;if(W){for(let A of T)if(vr(A.predicate)||ki(A.predicate)){let he=b.get(A.subject);he&&B.add(q(he))}}let G=W?$.filter(([A,he,Oe])=>O(A)||O(Oe)||B.has(q(he))):$,J=Math.max(0,n-Q.length),ie=J>0&&!H?uw(D,L,{budget:J,focus:V,presentTypeEdges:h}):[],de=Math.max(0,n-Q.length-ie.length),ae=de>0&&!H?dw(z,L,g,{budget:de,focus:V}):[],Z=Math.max(0,n-Q.length-ie.length-ae.length),Y=Z>0&&E.length&&!H?fw(G,h,L,E,{budget:Z,focus:V}):[],te=Math.max(0,n-Q.length-ie.length-ae.length-Y.length),re=te>0&&E.length>1&&!H?pw(E,L,{budget:te,focus:V}):[],Ae=new Map(E.map(A=>[A.restriction,A])),fe=[...Q.map(A=>({subject:A.subject,predicate:Be,object:A.object,provenance:rw,justification:[[ve(A.subject,Be,A.via),ve(A.via,Be,A.object)]]})),...ie.map(A=>({subject:A.subject,predicate:Dt,object:A.object,provenance:aw,justification:[[ve(A.subject,Dt,A.via),ve(A.via,Be,A.object)]]})),...ae.map(A=>{let he=P(A.viaClass,$r,A.object),[Oe,hs]=he?[A.viaClass,A.object]:[A.object,A.viaClass],gs=U([k(A.subject,Dt,A.viaType),k(Oe,$r,hs),...A.viaClass!==A.viaType?[k(A.viaType,Be,A.viaClass)]:[]]);return{subject:A.subject,predicate:$r,object:A.object,provenance:Cd,justification:[[ve(A.subject,Dt,A.viaType),ve(Oe,$r,hs),...A.viaClass!==A.viaType?[ve(A.viaType,Be,A.viaClass)]:[]]],...gs.length?{premiseTrusts:gs,ruleConfidence:Id}:{}}}),...Y.map(A=>{let he=U([k(A.subject,A.viaProperty,A.viaValue),k(A.viaValue,Dt,A.viaType),k(A.object,Rn,A.viaPropertyKey),k(A.object,_n,A.viaTarget),...A.viaType!==A.viaTarget?[k(A.viaType,Be,A.viaTarget)]:[]]);return{subject:A.subject,predicate:Dt,object:A.object,provenance:Nd,justification:[[ve(A.subject,A.viaProperty,A.viaValue),ve(A.viaValue,Dt,A.viaType),ve(A.object,Rn,A.viaPropertyKey),ve(A.object,_n,A.viaTarget),...A.viaType!==A.viaTarget?[ve(A.viaType,Be,A.viaTarget)]:[]]],...he.length?{premiseTrusts:he,ruleConfidence:Ld}:{}}}),...re.map(A=>{let he=Ae.get(A.subject),Oe=Ae.get(A.object),hs=U([he&&k(A.subject,Rn,he.property),k(A.subject,_n,A.viaY1),Oe&&k(A.object,Rn,Oe.property),k(A.object,_n,A.viaY2),k(A.viaY1,Be,A.viaY2)]);return{subject:A.subject,predicate:Be,object:A.object,provenance:Dd,justification:[[...he?[ve(A.subject,Rn,he.property)]:[],ve(A.subject,_n,A.viaY1),...Oe?[ve(A.object,Rn,Oe.property)]:[],ve(A.object,_n,A.viaY2),ve(A.viaY1,Be,A.viaY2)]],...hs.length?{premiseTrusts:hs,ruleConfidence:zd}:{}}})],Se=fe.map(A=>({id:ve(A.subject,A.predicate,A.object),subject:A.subject,predicate:A.predicate,object:A.object,environments:A.justification,write:A})),Le=bw(f.concat(Se.map(A=>({id:A.id,subject:A.subject,predicate:A.predicate,object:A.object})))),je=new Map(f.map(A=>[A.id,A])),Ye=A=>so(A)||No(A)||Oo(A),ce=A=>R!=="delta"||W!==null&&(W.has(A.subject)||W.has(A.object)),le=f.filter(A=>Ye(A.predicate)&&gw(A.provenance)&&ji(A).length<r&&ce(A)).map(A=>({id:A.id,subject:A.subject,predicate:A.predicate,object:A.object,environments:ji(A),provenance:A.provenance})),pe=[...Se,...le].sort((A,he)=>A.subject.localeCompare(he.subject)||A.predicate.localeCompare(he.predicate)||A.object.localeCompare(he.object)),Xe=0,wt=!1,se=0;for(let A of pe){if(se>=n){wt=!0;break}se+=1;let he=Le(A,{maxEnvironments:r+1}),{kept:Oe,truncated:hs}=WA(A.environments,he,r);if(hs&&(wt=!0),!(Oe.length<=A.environments.length)){if(Xe+=Oe.length-A.environments.length,A.write){A.write.justification=Oe;continue}fe.push({subject:A.subject,predicate:A.predicate,object:A.object,justification:Oe,...ww(A.provenance,Oe,gs=>je.get(gs)?.trust)||{}})}}let{ids:Pe}=await u(e,fe),st=[],Ue=0;for(let A of Q)st.push({id:Pe[Ue],subject:A.subject,object:A.object,via:A.via,rule:ow}),Ue+=1;for(let A of ie)st.push({id:Pe[Ue],subject:A.subject,object:A.object,via:A.via,rule:iw}),Ue+=1;for(let A of ae)st.push({id:Pe[Ue],subject:A.subject,object:A.object,via:A.viaClass,rule:Ad}),Ue+=1;for(let A of Y)st.push({id:Pe[Ue],subject:A.subject,object:A.object,via:A.viaValue,rule:Od}),Ue+=1;for(let A of re)st.push({id:Pe[Ue],subject:A.subject,object:A.object,via:A.viaY1,rule:Fd}),Ue+=1;let Us=st.length>=n;if(v===null&&d&&!Us){let A=new Set(C);for(let he of Pe)A.add(he);await a.saveSyllogiseState(e,{version:1,factIds:[...A].sort(),completedAt:new Date().toISOString()})}return{derived:st,count:st.length,budget:n,depth:t,truncated:Us,mode:R,deltaSize:I,environmentsAdded:Xe,alternatesTruncated:wt}}function gw(e){let t=String(e||"").split(" | ").filter(Boolean);return t.length>0&&t.every(n=>n.startsWith("entailed:"))}function BA(e){let t=[],n=new Map,s=new Map,o=new Map,r=new Map,i=new Map;for(let u of e){let d=String(u.predicate||"").trim().toLowerCase();so(u.predicate)?t.push([u.subject,u.object]):No(u.predicate)?(n.has(u.subject)||n.set(u.subject,new Set),n.get(u.subject).add(u.object)):Oo(u.predicate)?(s.has(u.subject)||s.set(u.subject,new Set),s.get(u.subject).add(u.object),s.has(u.object)||s.set(u.object,new Set),s.get(u.object).add(u.subject)):vr(u.predicate)?o.set(u.subject,u.object):ki(u.predicate)?r.set(u.subject,u.object):Pd.has(d)||(i.has(u.subject)||i.set(u.subject,[]),i.get(u.subject).push([q(u.predicate),u.object]))}let a=es(t),c=(u,d)=>u!==d&&a(u).has(d),l=u=>{let d=o.get(u),p=r.get(u);return d&&p?{property:q(d),target:p}:null};return u=>{if(so(u.predicate)){if(c(u.subject,u.object))return!0;let d=l(u.subject),p=l(u.object);return!!(d&&p&&d.property===p.property&&c(d.target,p.target))}if(No(u.predicate)){for(let p of n.get(u.subject)||[])if(c(p,u.object))return!0;let d=l(u.object);if(d){for(let[p,f]of i.get(u.subject)||[])if(p===d.property){for(let m of n.get(f)||[])if(m===d.target||c(m,d.target))return!0}}return!1}if(Oo(u.predicate)){for(let d of n.get(u.subject)||[])for(let p of[d,...a(d)])if(s.get(p)?.has(u.object))return!0;return!1}return!0}}function bw(e){let t=new Set,n=[],s=new Map,o=new Map,r=new Set,i=new Map,a=new Map,c=new Map,l=new Map;for(let f of e){if(!f||!f.subject||!f.predicate||!f.object)continue;f.id&&t.add(f.id);let m=String(f.predicate||"").trim().toLowerCase();so(f.predicate)?(n.push([f.subject,f.object]),s.has(f.subject)||s.set(f.subject,new Set),s.get(f.subject).add(f.object)):No(f.predicate)?(o.has(f.subject)||o.set(f.subject,new Set),o.get(f.subject).add(f.object)):Oo(f.predicate)?(r.add(`${f.subject}${We}${f.object}`),i.has(f.subject)||i.set(f.subject,new Set),i.get(f.subject).add(f.object),i.has(f.object)||i.set(f.object,new Set),i.get(f.object).add(f.subject)):vr(f.predicate)?a.set(f.subject,f.object):ki(f.predicate)?c.set(f.subject,f.object):Pd.has(m)||(l.has(f.subject)||l.set(f.subject,[]),l.get(f.subject).push([f.predicate,f.object]))}let u=es(n),d=f=>s.get(f)||new Set,p=f=>{let m=a.get(f),h=c.get(f);return m&&h?{property:m,propertyKey:q(m),target:h}:null};return(f,{maxEnvironments:m=xr}={})=>{let h=[],g=new Set,b=y=>{if(h.length>=m||f.id&&y.includes(f.id)||!y.every(E=>t.has(E)))return;let $=[...y].sort().join(" ");g.has($)||(g.add($),h.push(y))};if(so(f.predicate)){for(let y of[...d(f.subject)].sort()){if(h.length>=m)break;y===f.subject||y===f.object||d(y).has(f.object)&&b([ve(f.subject,Be,y),ve(y,Be,f.object)])}if(h.length<m){let y=p(f.subject),$=p(f.object);y&&$&&y.propertyKey===$.propertyKey&&y.target!==$.target&&d(y.target).has($.target)&&b([ve(f.subject,Rn,y.property),ve(f.subject,_n,y.target),ve(f.object,Rn,$.property),ve(f.object,_n,$.target),ve(y.target,Be,$.target)])}return h}if(No(f.predicate)){for(let $ of[...o.get(f.subject)||[]].sort()){if(h.length>=m)break;$!==f.object&&d($).has(f.object)&&b([ve(f.subject,Dt,$),ve($,Be,f.object)])}let y=p(f.object);if(y){let $=[...l.get(f.subject)||[]].filter(([E])=>q(E)===y.propertyKey).sort((E,_)=>E[0].localeCompare(_[0])||E[1].localeCompare(_[1]));for(let[E,_]of $){if(h.length>=m)break;for(let v of[...o.get(_)||[]].sort()){if(h.length>=m)break;v!==y.target&&!d(v).has(y.target)||b([ve(f.subject,E,_),ve(_,Dt,v),ve(f.object,Rn,y.propertyKey),ve(f.object,_n,y.target),...v!==y.target?[ve(v,Be,y.target)]:[]])}}}return h}if(Oo(f.predicate)){let y=[];for(let $ of o.get(f.subject)||[])for(let E of[$,...u($)])(i.get(E)||new Set).has(f.object)&&y.push([$,E]);y.sort(($,E)=>$[0].localeCompare(E[0])||$[1].localeCompare(E[1]));for(let[$,E]of y){if(h.length>=m)break;let _=r.has(`${E}${We}${f.object}`),[v,S]=_?[E,f.object]:[f.object,E];b([ve(f.subject,Dt,$),ve(v,$r,S),...E!==$?[ve($,Be,E)]:[]])}return h}return h}}function WA(e,t,n){let s=[],o=new Set,r=!1;for(let i of[...e||[],...t||[]]){if(!Array.isArray(i)||!i.length)continue;let a=[...i].sort().join(" ");if(!o.has(a)){if(s.length>=n){r=!0;continue}o.add(a),s.push(i)}}return{kept:s,truncated:r}}function ww(e,t,n){let s;for(let i of String(e||"").split(" | ")){let a=GA.get(i);if(a!==void 0){s=a;break}}if(s===void 0)return null;let o=null,r=-1;for(let i of t||[]){let a=i.map(l=>n(l)).filter(l=>typeof l=="number");if(a.length!==i.length)continue;let c=Math.min(...a);c>r&&(r=c,o=a)}return o?{premiseTrusts:o,ruleConfidence:s}:null}async function VA(e,t,n,{budget:s=50,depth:o=32,maxEnvironments:r=xr,store:i,sourceTags:a=[],predicate:c=Be}={}){let{loadMemory:l,readFactRows:u,removeFacts:d}=sw(i,["loadMemory","readFactRows","removeFacts"],"retractSubClassOf"),p=typeof i?.appendFacts=="function"?i.appendFacts:null,f=typeof i?.factRecordIdForTag=="function"?i.factRecordIdForTag:null,m=(a||[]).filter(Boolean);if(m.length&&!f)throw new TypeError("retractSubClassOf needs a store option carrying factRecordIdForTag (memory/core.mjs's) to scope a retraction to sourceTags");let h=q(t),g=q(n),b=ve(h,c,g),y=await l(e),$=u(y),E=new Map($.map(P=>[P.id,P]));if(!E.has(b))return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!1};let _=E.get(b).sourceIds||[],v=m.map(P=>f(b,P).slice(b.length+1)),S=m.length?_.filter(P=>v.includes(P)):[],C=!m.length||S.length>0;if(m.length&&!C)return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!0,ownRecord:!1,stillStands:!0};let x=m.length>0&&S.length<_.length,R=new Set([b]),w=[b],T=new Map,I=!1;if(!x){let P=$.filter(Q=>ji(Q).length&&gw(Q.provenance)),U=new Map;for(let Q of P)for(let L of ji(Q))for(let V of L)U.has(V)||U.set(V,new Set),U.get(V).add(Q.id);let H=0,X=[b];for(;H<o;H+=1){let Q=new Set;for(let z of X)for(let B of U.get(z)||[])R.has(B)||Q.add(B);let L=[...Q].map(z=>E.get(z)).sort((z,B)=>z.subject.localeCompare(B.subject)||z.predicate.localeCompare(B.predicate)||z.object.localeCompare(B.object));if(!L.length)break;let V=$.filter(z=>!R.has(z.id)&&!Q.has(z.id)),W=new Set(V.map(z=>z.id)),O=bw(V),D=BA(V),N=!1,F=!1;X=[];for(let z of L){if(R.size>=s){F=!0;break}let B=ji(z),G=B.filter(ie=>ie.every(de=>W.has(de)));if(G.length){G.length!==B.length&&T.set(z.id,G);continue}let J=O(z,{maxEnvironments:r});if(J.length){T.set(z.id,J);continue}D(z)||(R.add(z.id),w.push(z.id),X.push(z.id),N=!0)}if(F){I=!0;break}if(!N)break}!I&&H>=o&&(I=P.some(Q=>!R.has(Q.id)&&Q.justification.some(L=>R.has(L))))}let j=m.length?[...S.map(P=>`${b}@${P}`),...w.slice(1)]:w,{removed:k}=await d(e,j);if(p){let P=[...T.entries()].filter(([U])=>!R.has(U)).sort((U,H)=>U[0].localeCompare(H[0])).map(([U,H])=>{let X=E.get(U);return{subject:X.subject,predicate:X.predicate,object:X.object,justification:H,...ww(X.provenance,H,Q=>E.get(Q)?.trust)||{}}});P.length&&await p(e,P)}return{retracted:k,count:k.length,budget:s,depth:o,truncated:I,found:!0,...m.length?{ownRecord:!0,stillStands:x}:{}}}function ic(e){let t=new Map;for(let[n,s]of e||[])!n||!s||n===s||(t.has(n)||t.set(n,new Set),t.get(n).add(s));return t}function Ud(e,t,n,s,{maxHops:o=6}={}){let r=t instanceof Set?t:new Set(t||[]),i=s instanceof Map?s:ic(s),a=[];for(let[l,u]of n||[])l===e&&u&&a.push({node:u,path:[{subject:l,predicate:Dt,object:u}]});for(let l of i.get(e)||[])a.push({node:l,path:[{subject:e,predicate:Be,object:l}]});let c=new Set([e]);for(let l=1;l<=o&&a.length;l+=1){for(let{node:d,path:p}of a)if(r.has(d))return p;if(l===o)break;let u=[];for(let{node:d,path:p}of a)if(!c.has(d)){c.add(d);for(let f of i.get(d)||[])c.has(f)||u.push({node:f,path:[...p,{subject:d,predicate:Be,object:f}]})}a=u}return null}var Be,ow,rw,Dt,iw,aw,$r,Ad,Cd,Id,Rn,_n,Od,Nd,Ld,xr,We,so,No,Oo,vr,ki,IA,Pd,LA,PA,Fd,Dd,zd,MA,DA,ji,GA,Ot=M(()=>{it();Be="rdfs:subClassOf",ow="subClassOf",rw=`entailed:${ow}`,Dt="rdf:type",iw="type",aw=`entailed:${iw}`,$r="owl:disjointWith",Ad="disjointWith",Cd=`entailed:${Ad}`,Id=.95,Rn="owl:onProperty",_n="owl:someValuesFrom",Od="someValuesFrom",Nd=`entailed:${Od}`,Ld=.95,xr=4,We="\u241F",so=e=>String(e||"").trim().toLowerCase()==="rdfs:subclassof",No=e=>String(e||"").trim().toLowerCase()==="rdf:type",Oo=e=>String(e||"").trim().toLowerCase()==="owl:disjointwith",vr=e=>String(e||"").trim().toLowerCase()==="owl:onproperty",ki=e=>String(e||"").trim().toLowerCase()==="owl:somevaluesfrom",IA=e=>String(e||"").trim().toLowerCase()==="owl:onclass",Pd=new Set(["rdfs:subclassof","rdf:type","owl:disjointwith","owl:onproperty","owl:somevaluesfrom","owl:intersectionof"]);LA="has",PA={"owl:cardinality":"exactly","owl:mincardinality":"min","owl:maxcardinality":"max"};Fd="someValuesFromSubsumption",Dd=`entailed:${Fd}`,zd=.95;MA=.95;DA=.95;ji=e=>e.environments||(Array.isArray(e.justification)&&e.justification.length?[e.justification]:[]);GA=new Map([[Cd,Id],[Nd,Ld],[Dd,zd]])});function kr(e){let t=String(e||""),n=yw.get(t);return n||(t.startsWith(Bd)?Er+t.slice(Bd.length):t)}function $w(e){let t=String(e||""),n=HA.get(t);return n||(t.startsWith(Er)?Bd+t.slice(Er.length):null)}function Ew(e,t,n,s,o){let r=null;for(let i of e){if(i===t)return[];let a=Ud(i,new Set([t]),n,s,{maxHops:o});a&&(!r||a.length<r.length)&&(r=a)}return r}function lc(e,t,n,{maxHops:s=3}={}){let o=jr(e),r=jr(t),i=Array.isArray(n)?n:[],{typeEdges:a,subClassSucc:c}=xw(i),l=i.filter(b=>(b.predicate===cc||b.predicate===Sr)&&r.has(b.object)),u=[];for(let b of l){let y=b.predicate===Sr?"negative":"positive";if(o.has(b.subject)){u.push({fact:b,polarity:y,hops:0,chain:null});continue}let $=Ew(o,b.subject,a,c,s);$&&$.length&&u.push({fact:b,polarity:y,hops:$.length,chain:$})}if(!u.length)return{verdict:"none",hops:0,positive:[],negative:[],chain:null,overrides:null,baseRate:Gd(o,r,i,{maxHops:s})};u.sort((b,y)=>b.hops-y.hops||(y.fact.trust||0)-(b.fact.trust||0));let d=u[0].hops,p=u.filter(b=>b.hops===d),f=p.filter(b=>b.polarity==="positive").map(b=>b.fact),m=p.filter(b=>b.polarity==="negative").map(b=>b.fact),h=m.length&&!f.length?"negative":"positive",g=u.find(b=>b.hops>d&&b.polarity!==h)||null;return{verdict:f.length&&m.length?"both":m.length?"no":"yes",hops:d,positive:f,negative:m,chain:u[0].chain,overrides:g?{fact:g.fact,chain:g.chain}:null,baseRate:null}}function Gd(e,t,n,{maxHops:s=3}={}){let o=jr(e),r=jr(t),i=Array.isArray(n)?n:[],a=i.filter(h=>h.predicate===Be||h.predicate===Dt),c=a.filter(h=>o.has(h.subject)).map(h=>h.object);if(!c.length)return null;let l=c[0],u=[...new Set(a.filter(h=>h.object===l&&!o.has(h.subject)).map(h=>h.subject))],d=h=>{let g=i.find(b=>b.subject===h&&r.has(b.object)&&(b.predicate===cc||b.predicate===Sr));return g?{name:h,polarity:g.predicate===Sr?"negative":"positive",fact:g}:{name:h,polarity:"unknown",fact:null}},p=u.map(d),{typeEdges:f,subClassSucc:m}=xw(i);return{klass:l,kinds:u.length,positive:p.filter(h=>h.polarity==="positive"),negative:p.filter(h=>h.polarity==="negative"),unknown:p.filter(h=>h.polarity==="unknown"),chain:Ew(o,l,f,m,s)}}function Vd(e,t,{exclude:n=[],maxHops:s=3}={}){let o=jr(e),r=jr(n),i=Array.isArray(t)?t:[],a=new Set,c=[];for(let l of i)l.predicate!==cc||!o.has(l.object)||r.has(l.subject)||a.has(l.subject)||(a.add(l.subject),lc(new Set([l.subject]),o,i,{maxHops:s}).verdict==="yes"&&c.push(l));return c.sort(qA)}var Er,Bd,ac,yw,HA,vw,cc,Sr,Wd,qA,jr,xw,uc=M(()=>{Ot();Er="mgxneg:",Bd="mgx:",ac="mgxneg:subClassOf",yw=new Map([[Be,ac]]),HA=new Map([...yw].map(([e,t])=>[t,e]));vw=e=>String(e||"").startsWith(Er),cc="mgx:capableOf",Sr=kr(cc),Wd=6,qA=(e,t)=>(t.trust||0)-(e.trust||0)||String(e.subject).localeCompare(String(t.subject)),jr=e=>e instanceof Set?e:new Set(Array.isArray(e)?e:[e]),xw=e=>{let t=e.filter(s=>s.predicate===Dt).map(s=>[s.subject,s.object]),n=e.filter(s=>s.predicate===Be).map(s=>[s.subject,s.object]);return{typeEdges:t,subClassSucc:ic(n)}}});function dc(e){let t=String(e||"");return Kd.has(t)?Hd:YA.has(t)||XA.test(t)?Ri:JA.has(t)?Sw:qd}function QA(e){let t=e?.observedAt;if(t&&Number.isFinite(Date.parse(t)))return String(t);if(wh.has(e?.sourceType)){for(let n of[e?.assertedAt,e?.createdAt])if(n&&Number.isFinite(Date.parse(n)))return String(n)}}function ZA(e,t){let n=null;for(let s of e?.assertions||[]){let o=Date.parse(QA(s)??"");Number.isFinite(o)&&(n===null||(t?o<n:o>n))&&(n=o)}return n}function Yd(e,t){let n=t===Sw;if(!n&&t!==Ri)return null;let s=(e||[]).map(r=>({row:r,at:ZA(r,n)}));s.sort((r,i)=>{if(r.at!==i.at)return r.at===null?1:i.at===null?-1:n?r.at-i.at:i.at-r.at;let a=(i.row.trust||0)-(r.row.trust||0);if(a)return a;let[c,l]=[String(r.row.object),String(i.row.object)];return c<l?-1:c>l?1:0});let o=s.map(r=>r.row);return{winner:o[0]||null,ranked:o,contested:s.length>1&&s[0].at===s[1].at}}var Hd,Ri,Sw,qd,KA,Kd,YA,XA,JA,jw=M(()=>{uc();Dn();Hd="merge",Ri="latest-observation-wins",Sw="first-claim-wins",qd="contradiction",KA=["mgx:hasA","mgx:capableOf","rdfs:subClassOf","rdf:type","owl:disjointWith","mgx:partOf","mgx:memberOf","mgx:collectionOf","mgx:usedFor","mgx:receivesAction","mgx:causes","mgx:causesDesire","mgx:hasSubevent","mgx:hasPrerequisite","mgx:motivatedByGoal","mgx:obstructedBy","mgx:desires","mgx:hasProperty","mgx:madeOf","mgx:atLocation","mgx:locatedNear","mgx:createdBy","mgx:mannerOf","mgx:relatedTo","mgx:synonym","mgx:antonym","mgx:similarTo","mgx:symbolOf","mgx:knows-about"],Kd=new Set(KA.flatMap(e=>[e,kr(e)])),YA=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:hidden-in","mgx:on-top-of","mgx:on-plane","mgx:under","mgx:is-open","mgx:hasMass","mgx:feels","mgx:faces","mgx:pose","mgx:display-name","mgx:nodeName","mgx:worldName"]),XA=/^mgx:has-exit-([a-z]+)$/,JA=new Set(["mgx:playedBy"])});function Ai(e){let t=String(e||""),n=t.indexOf(fc);return n<0?"":t.slice(n+fc.length)}function oC(e){let t=1,n=0;for(let s of e)t*=1-nC(s),n+=1;return n?sC(Math.min(1,1-t)):0}function Aw(e,t,n){let s=Date.parse(e),o=Date.parse(t);return Number.isFinite(s)?Number.isFinite(o)?n(s,o)===s?String(e):String(t):String(e):Number.isFinite(o)?String(t):""}function Ow(e,t){let n=Date.parse(e.assertedAt),s=Date.parse(t.assertedAt),o=Number.isFinite(n)?n:-1/0,r=Number.isFinite(s)?s:-1/0;return o!==r?r-o:e.id<t.id?-1:e.id>t.id?1:0}function Nw(e,t="",n=""){let s=t,o=n;for(let r of e)s=Cw(s,r.assertedAt),o=Iw(o,r.assertedAt);return{earliest:s,latest:o}}function Zd({id:e,sourceKey:t,template:n,idsProp:s,ids:o,earliest:r,latest:i,priorFor:a}){let c=[...new Set(o)].filter(Boolean).sort(),l=a?oC(c.map(u=>a(u))):void 0;return{id:e,label:n?.label||"",class:eC,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"rdf:Statement"},{prop:"rdf:subject",key:"subject",value:n?.subject||""},{prop:"rdf:predicate",key:"predicate",value:n?.predicate||""},{prop:"rdf:object",key:"object",value:n?.object||""},{prop:"mgx:createdAt",key:"createdAt",value:r},{prop:"mgx:sourceId",key:"sourceId",value:t},{prop:s,key:s===Rr?"rollupSourceIds":"rollupRecordIds",value:c.join(" ")},{prop:Ti,key:"rollupCount",value:String(c.length)},{prop:ts,key:"rollupEarliest",value:r},{prop:ns,key:"rollupLatest",value:i},...l===void 0?[]:[{prop:_r,key:"rollupPrior",value:String(l)}]]}}function Lw({groupId:e,sourceType:t,heads:n=[],existing:s=null,priorFor:o}){if(!e||!t||n.length<64||n.length<=8)return null;let i=n.slice().sort(Ow).slice(8);if(!i.length)return null;let{earliest:a,latest:c}=Nw(i,zt(s,ts),zt(s,ns));return{rollup:Zd({id:Xd(e,t),sourceKey:`rollup:${t}`,template:ef(i[0].record||s),idsProp:Rr,ids:[...hc(s),...i.map(u=>u.sourceId)],earliest:a,latest:c,priorFor:o}),absorbed:i.map(u=>u.id),absorbedSourceIds:i.map(u=>u.sourceId)}}function Pw({groupId:e,sourceId:t,leaves:n=[],existing:s=null}){if(!e||!t||n.length<8||n.length<=2)return null;let o=n.slice().sort(Ow),r=o.slice(0,2),i=o.slice(2);if(!i.length)return null;let{earliest:a,latest:c}=Nw(i,zt(s,ts),zt(s,ns));return{rollup:Zd({id:Jd(e,t),sourceKey:t,template:ef(i[0].record||s),idsProp:_i,ids:[...tC(s),...i.map(u=>u.id)],earliest:a,latest:c}),absorbed:i.map(u=>u.id),rewire:r[r.length-1]?.id||""}}function tf(e,t,{priorFor:n}={}){let s=e?.id||t?.id,o=oo(s),r=o?Rr:_i,i=a=>Qd(zt(a,r));return Zd({id:s,sourceKey:zt(e,"mgx:sourceId")||zt(t,"mgx:sourceId"),template:ef(zt(e,"rdf:subject")?e:t),idsProp:r,ids:[...i(e),...i(t)],earliest:Cw(zt(e,ts),zt(t,ts)),latest:Iw(zt(e,ns),zt(t,ns)),priorFor:o?n:void 0})}function Mw(e,t){if(!t)return!1;for(let n of e||[])if(hc(n).includes(t))return!0;return!1}var eC,kw,Rw,pc,_w,Rr,_i,Ti,ts,ns,_r,fc,Tw,Xd,Jd,oo,Tr,mc,zt,Qd,hc,tC,nC,sC,Cw,Iw,ef,nf=M(()=>{eC="Fact",kw=64,Rw=8,pc=8,_w=2,Rr="mgx:rollupSourceIds",_i="mgx:rollupRecordIds",Ti="mgx:rollupCount",ts="mgx:rollupEarliest",ns="mgx:rollupLatest",_r="mgx:rollupPrior",fc="@rollup:",Tw="#rollup",Xd=(e,t)=>`${e}${fc}${t}`,Jd=(e,t)=>`${e}@${t}${Tw}`,oo=e=>String(e||"").includes(fc),Tr=e=>String(e||"").endsWith(Tw),mc=e=>oo(e)||Tr(e);zt=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",Qd=e=>String(e||"").split(" ").filter(Boolean),hc=e=>Qd(zt(e,Rr)),tC=e=>Qd(zt(e,_i)),nC=e=>Math.max(0,Math.min(1,Number(e)||0)),sC=e=>Number(e.toFixed(6));Cw=(e,t)=>Aw(e,t,Math.min),Iw=(e,t)=>Aw(e,t,Math.max);ef=e=>({label:e?.label||"",subject:zt(e,"rdf:subject"),predicate:zt(e,"rdf:predicate"),object:zt(e,"rdf:object")})});function af(e){let t=String(e||"");return rf(t)?t.slice(0,-yc.length):""}function Fw(e,t){let n=Date.parse(e),s=Date.parse(t);return Number.isFinite(n)?Number.isFinite(s)&&s>n?String(t):String(e):Number.isFinite(s)?String(t):""}function cf({id:e,sourceId:t,template:n,ids:s,retractedAt:o,tags:r}){let i=[...new Set(s)].filter(Boolean).sort(),a=[...new Set(r)].filter(Boolean).sort();return{id:e,label:n?.label||"",class:yn,derived_from:[],mentions:[],attributes:[{prop:"rdf:subject",key:"subject",value:n?.subject||""},{prop:"rdf:predicate",key:"predicate",value:n?.predicate||""},{prop:"rdf:object",key:"object",value:n?.object||""},{prop:"mgx:sourceId",key:"sourceId",value:t||""},{prop:bc,key:"retractedRecordIds",value:i.join(" ")},{prop:sf,key:"retractedCount",value:String(i.length)},{prop:wc,key:"retractedAt",value:o||""},...a.length?[{prop:Ci,key:"provenance",value:a.join(" | ")}]:[]]}}function zw({groupId:e,sourceId:t,recordIds:n=[],retractedAt:s="",existing:o=null,template:r=null,provenance:i=""}){if(!e||!t)return null;let a=[...Lo(o),...n].filter(Boolean);return a.length?cf({id:of(e,t),sourceId:t,template:r||Dw(o),ids:a,retractedAt:Fw(Po(o),s),tags:[...Ii(Tn(o,Ci)),...Ii(i)]}):null}function Uw(e,t){let n=Dw(Tn(e,"rdf:subject")?e:t);return cf({id:e?.id||t?.id,sourceId:Tn(e,"mgx:sourceId")||Tn(t,"mgx:sourceId"),template:n,ids:[...Lo(e),...Lo(t)],retractedAt:Fw(Po(e),Po(t)),tags:[...Ii(Tn(e,Ci)),...Ii(Tn(t,Ci))]})}function iC(e,t){let n=Date.parse(e),s=Date.parse(t);return!Number.isFinite(s)||!Number.isFinite(n)?!0:n<=s}function aC(e,t,n=""){return!e||!t||!Lo(e).includes(t)?!1:iC(n,Po(e))}function $c(e,t,n=""){for(let s of e||[])if(aC(s,t,n))return!0;return!1}function cC(e,t){let n=[...new Set(t||[])].filter(Boolean).sort();return[e||"-",...n].join(" ")}function lC(e){let t=String(e||"").split(" ").filter(Boolean),n=t[0]||"",s=n==="-"||!Number.isFinite(Date.parse(n))?"":n,o=s||n==="-"?t.slice(1):t;return{retractedAt:s,ids:o}}function vc(e){let t=af(e?.id);return t?{id:e.id,subject:t,predicate:gc,object:cC(Po(e),Lo(e)),provenance:Tn(e,Ci)}:null}function xc(e){if(!e||e.predicate!==gc)return null;let t=String(e.subject||""),n=t.indexOf("@");if(n<=0||n===t.length-1)return null;let{retractedAt:s,ids:o}=lC(e.object);return o.length?cf({id:`${t}${yc}`,sourceId:t.slice(n+1),template:null,ids:o,retractedAt:s,tags:Ii(e.provenance)}):null}var yn,gc,bc,wc,sf,yc,Ci,of,rf,Tn,rC,Ii,Lo,Po,Dw,lf=M(()=>{yn="Retraction",gc="mgx:retracted",bc="mgx:retractedRecordIds",wc="mgx:retractedAt",sf="mgx:retractedCount",yc="#retracted",Ci="mgx:factProvenance",of=(e,t)=>`${e}@${t}${yc}`,rf=e=>String(e||"").endsWith(yc);Tn=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",rC=e=>String(e||"").split(" ").filter(Boolean),Ii=e=>String(e||"").split(" | ").filter(Boolean),Lo=e=>rC(Tn(e,bc)),Po=e=>Tn(e,wc);Dw=e=>({label:e?.label||"",subject:Tn(e,"rdf:subject"),predicate:Tn(e,"rdf:predicate"),object:Tn(e,"rdf:object")})});var uC,dC,fC,pC,uf,xU,Bw=M(()=>{Dn();uC="mgx:worldName",dC="mgx:nodeName",fC="mgx:playedBy",pC="mgx:waved",uf="mgx:invitedBy",xU=Object.freeze([uC,dC,fC,pC,uf])});function Ec(e){let t=new Set;for(let n of e||[])n?.predicate===uf&&(n.subject&&t.add(String(n.subject)),n.object&&t.add(String(n.object)));return[...t].sort()}function df(e,t=""){let n=String(t||"");return(e||[]).map(String).filter(s=>s&&s!==n)}function Sc({recordIds:e=[],roster:t=[],self:n="",acknowledgedBy:s=null}={}){let o=df(t,n);if(!o.length)return[];if(typeof s!="function")return[];let r=new Map;for(let a of o){let c=s(a);r.set(a,new Set([...c||[]].map(String)))}return[...new Set((e||[]).map(String).filter(Boolean))].sort().filter(a=>o.every(c=>r.get(c).has(a)))}var ff=M(()=>{Bw()});function Is(e,t){let n=(e?.attributes||[]).find(s=>s?.prop===t);return n?String(n.value??""):void 0}function yC(e,t){(!e?.class||!mC.has(e.class))&&t.push(`must have a class from the closed vocabulary Utterance | Fact | Session | Source | Rule (got ${JSON.stringify(e?.class)})`)}function $C(e,t){for(let i of["rdf:subject","rdf:predicate","rdf:object"])Oi(Is(e,i))||t.push(`a Fact needs a non-empty ${i}`);for(let i of["rdf:subject","rdf:object"]){let a=Is(e,i);a!==void 0&&gC.test(a)&&t.push(`a Fact's ${i} must be a single term, not text spanning a sentence boundary (got ${JSON.stringify(a)})`)}let n=Is(e,"mgx:factProvenance");n!==void 0&&!Oi(n)&&t.push("mgx:factProvenance, when present, must be non-empty");let s=typeof e?.id=="string"?e.id:"";bC(s)&&!Gw.test(s)&&t.push(`a Fact record id must read <groupId>@<sourceId>, optionally suffixed #v<n> once superseded (got ${JSON.stringify(s)})`);let o=Is(e,"mgx:sourceId");o!==void 0&&!Oi(o)&&t.push("mgx:sourceId, when present, must be non-empty (every assertion record has a key, src:none included)");let r=Is(e,"mgx:observedAt");r!==void 0&&!Number.isFinite(Date.parse(r))&&t.push(`mgx:observedAt, when present, must be a parseable instant (got ${JSON.stringify(r)})`);for(let i of wC){let a=Is(e,i);if(a===void 0)continue;let c=a.split(" ").filter(Boolean);c.length||t.push(`${i}, when present, must name at least one record id`);for(let l of c)Gw.test(l)||t.push(`${i} must name Fact record ids (got ${JSON.stringify(l)})`)}}function vC(e,t){Oi(Is(e,"mgx:ruleName"))||t.push("a Rule needs a non-empty mgx:ruleName");let n=Is(e,"mgx:ruleKind");if(!n||!Ww.has(n)){t.push(`a Rule's mgx:ruleKind must be one of ${[...Ww].join(" | ")} (got ${JSON.stringify(n)})`);return}for(let s of hC[n])Oi(Is(e,s))||t.push(`a ${n} Rule needs a non-empty ${s}`)}function xC(e){let t=[];return yC(e,t),e?.class==="Fact"&&$C(e,t),e?.class==="Rule"&&vC(e,t),{ok:t.length===0,violations:t}}function pf(e){let t=xC(e);if(!t.ok){let n=new Error(`SHACL validation failed for ${e?.class} "${e?.id}": ${t.violations.join(" | ")}`);throw n.violations=t.violations,n}}var mC,Ww,hC,gC,Gw,bC,wC,Oi,Vw=M(()=>{mC=new Set(["Utterance","Fact","Session","Source","Rule"]),Ww=new Set(["compose2","filter","recursive","action-signature","action-precond","action-effect","action-constraint"]),hC={compose2:["mgx:ruleBase1","mgx:ruleBase2"],filter:["mgx:ruleBase1","mgx:ruleFilterProperty"],recursive:["mgx:ruleBaseCase","mgx:ruleRecStep"],"action-signature":["mgx:ruleActionSubjectClass","mgx:ruleActionTargetClass"],"action-precond":["mgx:ruleActionPrecondShape","mgx:ruleActionPrecondPredicate","mgx:ruleActionPrecondRole","mgx:ruleActionPrecondScope"],"action-effect":["mgx:ruleActionEffectPredicate","mgx:ruleActionEffectSubject"],"action-constraint":["mgx:ruleActionConstraintLeft","mgx:ruleActionConstraintRight","mgx:ruleActionConstraintGuard"]},gC=/[.!?]\s+\w/,Gw=/^[^@]+@(.+?)(#v[1-9][0-9]*)?$/,bC=e=>e.includes("@")||/#v\d/.test(e),wC=["mgx:supersedes","mgx:supersededBy"];Oi=e=>typeof e=="string"&&e.trim().length>0});var Hw={};Lt(Hw,{access:()=>jC,appendFile:()=>_C,basename:()=>GC,copyFile:()=>LC,createInterface:()=>YC,createReadStream:()=>MC,createRequire:()=>EC,createWriteStream:()=>FC,default:()=>JC,dirname:()=>UC,existsSync:()=>DC,fileURLToPath:()=>HC,isAbsolute:()=>WC,join:()=>zC,mkdir:()=>TC,mkdtemp:()=>AC,randomBytes:()=>qC,readFile:()=>kC,readFileSync:()=>SC,readdir:()=>PC,rename:()=>CC,resolve:()=>BC,rm:()=>OC,sep:()=>VC,spawnSync:()=>KC,stat:()=>NC,tmpdir:()=>XC,unlink:()=>IC,writeFile:()=>RC});var xt,EC,SC,jC,kC,RC,_C,TC,AC,CC,IC,OC,NC,LC,PC,MC,FC,DC,zC,UC,BC,WC,GC,VC,HC,qC,KC,YC,XC,JC,qw=M(()=>{xt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},EC=xt("createRequire"),SC=xt("readFileSync"),jC=xt("access"),kC=xt("readFile"),RC=xt("writeFile"),_C=xt("appendFile"),TC=xt("mkdir"),AC=xt("mkdtemp"),CC=xt("rename"),IC=xt("unlink"),OC=xt("rm"),NC=xt("stat"),LC=xt("copyFile"),PC=xt("readdir"),MC=xt("createReadStream"),FC=xt("createWriteStream"),DC=()=>!1,zC=(...e)=>e.join("/"),UC=e=>String(e).replace(/\/[^/]*$/,""),BC=(...e)=>e.join("/"),WC=e=>String(e).startsWith("/"),GC=e=>String(e).split("/").pop(),VC="/",HC=e=>String(e),qC=xt("randomBytes"),KC=xt("spawnSync"),YC=xt("createInterface"),XC=()=>"/tmp",JC={}});var QC,Ni,mf=M(()=>{QC=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,Ni=class e extends Date{#t=!1;#n=!1;#e=null;constructor(t){let n=!0,s=!0,o="Z";if(typeof t=="string"){let r=t.match(QC);r?(r[1]||(n=!1,t=`0000-01-01T${t}`),s=!!r[2],s&&t[10]===" "&&(t=t.replace(" ","T")),r[2]&&+r[2]>23?t="":(o=r[3]||null,t=t.toUpperCase(),!o&&s&&(t+="Z"))):t=""}super(t),isNaN(this.getTime())||(this.#t=n,this.#n=s,this.#e=o)}isDateTime(){return this.#t&&this.#n}isLocal(){return!this.#t||!this.#n||!this.#e}isDate(){return this.#t&&!this.#n}isTime(){return this.#n&&!this.#t}isValid(){return this.#t||this.#n}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(this.#e===null)return t.slice(0,-1);if(this.#e==="Z")return t;let n=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return n=this.#e[0]==="-"?n:-n,new Date(this.getTime()-n*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(t,n="Z"){let s=new e(t);return s.#e=n,s}static wrapAsLocalDateTime(t){let n=new e(t);return n.#e=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#n=!1,n.#e=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#t=!1,n.#e=null,n}}});function ZC(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function eI(e,t,n){let s=e.split(/\r\n|\n|\r/g),o="",r=(Math.log10(t+1)|0)+1;for(let i=t-1;i<=t+1;i++){let a=s[i-1];a&&(o+=i.toString().padEnd(r," "),o+=": ",o+=a,o+=`
86
86
  `,i===t&&(o+=" ".repeat(r+n+2),o+=`^
87
- `))}return o}var $e,Po=M(()=>{$e=class extends Error{line;column;codeblock;constructor(t,n){let[s,o]=BC(n.toml,n.ptr),r=WC(n.toml,s,o);super(`Invalid TOML document: ${t}
87
+ `))}return o}var $e,Mo=M(()=>{$e=class extends Error{line;column;codeblock;constructor(t,n){let[s,o]=ZC(n.toml,n.ptr),r=eI(n.toml,s,o);super(`Invalid TOML document: ${t}
88
88
 
89
- ${r}`,n),this.line=s,this.column=o,this.codeblock=r}}});function Ec(e,t){let n=e[t++],s=n,o=n==="'",r=n===e[t]&&n===e[t+1];r&&(e[t+=2]===`
89
+ ${r}`,n),this.line=s,this.column=o,this.codeblock=r}}});function jc(e,t){let n=e[t++],s=n,o=n==="'",r=n===e[t]&&n===e[t+1];r&&(e[t+=2]===`
90
90
  `?t++:e[t]==="\r"&&e[t+1]===`
91
91
  `&&(t+=2));let i="",a=t,c=0;for(let l=t;l<e.length;l++)if(n=e[l],r&&(n===`
92
92
  `||n==="\r"&&e[l+1]===`
93
93
  `))c=c&&3;else{if(n<" "&&n!==" "||n==="\x7F")throw new $e("control characters are not allowed in strings",{toml:e,ptr:l});if((!c||c===3)&&n===s&&(!r||e[l+1]===s&&e[l+2]===s))return r&&(e[l+3]===s&&l++,e[l+3]===s&&l++),[c?i:i+e.slice(a,l),l+(r?3:1)];if(!c)!o&&n==="\\"&&(i+=e.slice(a,a=l),c=1);else if(c===1)if(n==="x"||n==="u"||n==="U"){let u=0,d=n==="x"?2:n==="u"?4:8;for(let p=0;p<d;p++,l++){let f=e.charCodeAt(l+1),m=f>=48&&f<=57?f-48:f>=65&&f<=70?f-65+10:f>=97&&f<=102?f-97+10:-1;if(m<0)throw new $e("invalid non-hex character in unicode escape",{toml:e,ptr:l+1});u=u<<4|m}if(u<0||u>1114111||u>=55296&&u<=57343)throw new $e("invalid unicode escape",{toml:e,ptr:l});i+=String.fromCodePoint(u),a=l+1,c=0}else if(n===" "||n===" ")c=2;else{if(n==="b")i+="\b";else if(n==="t")i+=" ";else if(n==="n")i+=`
94
- `;else if(n==="f")i+="\f";else if(n==="r")i+="\r";else if(n==="e")i+="\x1B";else if(n==='"')i+='"';else if(n==="\\")i+="\\";else throw new $e("unrecognized escape sequence",{toml:e,ptr:l});a=l+1,c=0}else if(n!==" "&&n!==" "){if(c===2)throw new $e("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});c=!o&&n==="\\"?1:0,a=l}}throw new $e("unfinished string",{toml:e,ptr:t})}function Gw(e,t,n,s){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return s?0n:0;let o=GC.test(e);if(o||VC.test(e)){if(HC.test(e))throw new $e("leading zeroes are not allowed",{toml:t,ptr:n});e=e.replace(/_/g,"");let i=+e;if(isNaN(i))throw new $e("invalid number",{toml:t,ptr:n});if(o){if((o=!Number.isSafeInteger(i))&&!s)throw new $e("integer value cannot be represented losslessly",{toml:t,ptr:n});(o||s===!0)&&(i=BigInt(e))}return i}let r=new Ci(e);if(!r.isValid())throw new $e("invalid value",{toml:t,ptr:n});return r}var GC,VC,HC,ff=M(()=>{df();Po();GC=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,VC=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,HC=/^[+-]?0[0-9_]/});function Sc(e,t=0,n=e.length){let s=e.indexOf(`
94
+ `;else if(n==="f")i+="\f";else if(n==="r")i+="\r";else if(n==="e")i+="\x1B";else if(n==='"')i+='"';else if(n==="\\")i+="\\";else throw new $e("unrecognized escape sequence",{toml:e,ptr:l});a=l+1,c=0}else if(n!==" "&&n!==" "){if(c===2)throw new $e("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});c=!o&&n==="\\"?1:0,a=l}}throw new $e("unfinished string",{toml:e,ptr:t})}function Kw(e,t,n,s){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return s?0n:0;let o=tI.test(e);if(o||nI.test(e)){if(sI.test(e))throw new $e("leading zeroes are not allowed",{toml:t,ptr:n});e=e.replace(/_/g,"");let i=+e;if(isNaN(i))throw new $e("invalid number",{toml:t,ptr:n});if(o){if((o=!Number.isSafeInteger(i))&&!s)throw new $e("integer value cannot be represented losslessly",{toml:t,ptr:n});(o||s===!0)&&(i=BigInt(e))}return i}let r=new Ni(e);if(!r.isValid())throw new $e("invalid value",{toml:t,ptr:n});return r}var tI,nI,sI,hf=M(()=>{mf();Mo();tI=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,nI=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,sI=/^[+-]?0[0-9_]/});function kc(e,t=0,n=e.length){let s=e.indexOf(`
95
95
  `,t);return e[s-1]==="\r"&&s--,s<=n?s:-1}function Ar(e,t){for(let n=t;n<e.length;n++){let s=e[n];if(s===`
96
96
  `)return n;if(s==="\r"&&e[n+1]===`
97
97
  `)return n+1;if(s<" "&&s!==" "||s==="\x7F")throw new $e("control characters are not allowed in comments",{toml:e,ptr:t})}return e.length}function ss(e,t,n,s){let o;for(;;){for(;(o=e[t])===" "||o===" "||!n&&(o===`
98
98
  `||o==="\r"&&e[t+1]===`
99
- `);)t++;if(s||o!=="#")break;t=Ar(e,t)}return t}function Vw(e,t,n,s,o=!1){if(!s)return t=Sc(e,t),t<0?e.length:t;for(let r=t;r<e.length;r++){let i=e[r];if(i==="#")r=Sc(e,r);else{if(i===n)return r+1;if(i===s||o&&(i===`
99
+ `);)t++;if(s||o!=="#")break;t=Ar(e,t)}return t}function Yw(e,t,n,s,o=!1){if(!s)return t=kc(e,t),t<0?e.length:t;for(let r=t;r<e.length;r++){let i=e[r];if(i==="#")r=kc(e,r);else{if(i===n)return r+1;if(i===s||o&&(i===`
100
100
  `||i==="\r"&&e[r+1]===`
101
- `))return r}}throw new $e("cannot find end of structure",{toml:e,ptr:t})}var jc=M(()=>{Po();});function qC(e,t,n){let s=e.slice(t,n),o=s.indexOf("#");return o>-1&&(Ar(e,o),s=s.slice(0,o)),[s.trimEnd(),o]}function Ii(e,t,n,s,o){if(s===0)throw new $e("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let r=e[t];if(r==="["||r==="{"){let[c,l]=r==="["?qw(e,t,s,o):Hw(e,t,s,o);if(n){if(l=ss(e,l),e[l]===",")l++;else if(e[l]!==n)throw new $e("expected comma or end of structure",{toml:e,ptr:l})}return[c,l]}if(r==='"'||r==="'"){let[c,l]=Ec(e,t);if(n){if(l=ss(e,l),e[l]&&e[l]!==","&&e[l]!==n&&e[l]!==`
102
- `&&e[l]!=="\r")throw new $e("unexpected character encountered",{toml:e,ptr:l});e[l]===","&&l++}return[c,l]}let i=Vw(e,t,",",n),a=qC(e,t,i-(e[i-1]===","?1:0));if(!a[0])throw new $e("incomplete key-value declaration: no value specified",{toml:e,ptr:t});return n&&a[1]>-1&&(i=ss(e,t+a[1]),e[i]===","&&i++),[Gw(a[0],e,t,o),i]}var pf=M(()=>{ff();mf();jc();Po();});function kc(e,t,n="="){let s=t-1,o=[],r=e.indexOf(n,t);if(r<0)throw new $e("incomplete key-value: cannot find end of key",{toml:e,ptr:t});do{let i=e[t=++s];if(i!==" "&&i!==" ")if(i==='"'||i==="'"){if(i===e[t+1]&&i===e[t+2])throw new $e("multiline strings are not allowed in keys",{toml:e,ptr:t});let[a,c]=Ec(e,t);s=e.indexOf(".",c);let l=e.slice(c,s<0||s>r?r:s),u=Sc(l);if(u>-1)throw new $e("newlines are not allowed in keys",{toml:e,ptr:t+s+u});if(l.trimStart())throw new $e("found extra tokens after the string part",{toml:e,ptr:c});if(r<c&&(r=e.indexOf(n,c),r<0))throw new $e("incomplete key-value: cannot find end of key",{toml:e,ptr:t});o.push(a)}else{s=e.indexOf(".",t);let a=e.slice(t,s<0||s>r?r:s);if(!KC.test(a))throw new $e("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:t});o.push(a.trimEnd())}}while(s+1&&s<r);return[o,ss(e,r+1,!0,!0)]}function Hw(e,t,n,s){let o={},r=new Set,i;for(t++;(i=e[t++])!=="}"&&i;){if(i===",")throw new $e("expected value, found comma",{toml:e,ptr:t-1});if(i==="#")t=Ar(e,t);else if(i!==" "&&i!==" "&&i!==`
103
- `&&i!=="\r"){let a,c=o,l=!1,[u,d]=kc(e,t-1);for(let m=0;m<u.length;m++){if(m&&(c=l?c[a]:c[a]={}),a=u[m],(l=Object.hasOwn(c,a))&&(typeof c[a]!="object"||r.has(c[a])))throw new $e("trying to redefine an already defined value",{toml:e,ptr:t});!l&&a==="__proto__"&&Object.defineProperty(c,a,{enumerable:!0,configurable:!0,writable:!0})}if(l)throw new $e("trying to redefine an already defined value",{toml:e,ptr:t});let[p,f]=Ii(e,d,"}",n-1,s);r.add(p),c[a]=p,t=f}}if(!i)throw new $e("unfinished table encountered",{toml:e,ptr:t});return[o,t]}function qw(e,t,n,s){let o=[],r;for(t++;(r=e[t++])!=="]"&&r;){if(r===",")throw new $e("expected value, found comma",{toml:e,ptr:t-1});if(r==="#")t=Ar(e,t);else if(r!==" "&&r!==" "&&r!==`
104
- `&&r!=="\r"){let i=Ii(e,t-1,"]",n-1,s);o.push(i[0]),t=i[1]}}if(!r)throw new $e("unfinished array encountered",{toml:e,ptr:t});return[o,t]}var KC,mf=M(()=>{ff();pf();jc();Po();KC=/^[a-zA-Z0-9-_]+[ \t]*$/});function Kw(e,t,n,s){let o=t,r=n,i,a=!1,c;for(let l=0;l<e.length;l++){if(l){if(o=a?o[i]:o[i]={},r=(c=r[i]).c,s===0&&(c.t===1||c.t===2))return null;if(c.t===2){let u=o.length-1;o=o[u],r=r[u].c}}if(i=e[l],(a=Object.hasOwn(o,i))&&r[i]?.t===0&&r[i]?.d)return null;a||(i==="__proto__"&&(Object.defineProperty(o,i,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(r,i,{enumerable:!0,configurable:!0,writable:!0})),r[i]={t:l<e.length-1&&s===2?3:s,d:!1,i:0,c:{}})}if(c=r[i],c.t!==s&&!(s===1&&c.t===3)||(s===2&&(c.d||(c.d=!0,o[i]=[]),o[i].push(o={}),c.c[c.i++]=c={t:1,d:!1,i:0,c:{}}),c.d))return null;if(c.d=!0,s===1)o=a?o[i]:o[i]={};else if(s===0&&a)return null;return[i,o,c.c]}function Mo(e,{maxDepth:t=1e3,integersAsBigInt:n}={}){let s={},o={},r=s,i=o;for(let a=ss(e,0);a<e.length;){if(e[a]==="["){let c=e[++a]==="[",l=kc(e,a+=+c,"]");if(c){if(e[l[1]-1]!=="]")throw new $e("expected end of table declaration",{toml:e,ptr:l[1]-1});l[1]++}let u=Kw(l[0],s,o,c?2:1);if(!u)throw new $e("trying to redefine an already defined table or value",{toml:e,ptr:a});i=u[2],r=u[1],a=l[1]}else{let c=kc(e,a),l=Kw(c[0],r,i,0);if(!l)throw new $e("trying to redefine an already defined table or value",{toml:e,ptr:a});let u=Ii(e,c[1],void 0,t,n);l[1][l[0]]=u[0],a=u[1]}if(a=ss(e,a,!0),e[a]&&e[a]!==`
105
- `&&e[a]!=="\r")throw new $e("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:a});a=ss(e,a)}return s}var Yw=M(()=>{mf();pf();jc();Po();});var Xw=M(()=>{});var Rc=M(()=>{Yw();Xw();df();Po();});var hf={};Nt(hf,{CONFIG_FILE:()=>Tc,loadTomlConfig:()=>Ac,mergeEffective:()=>Qw,normalizeConfig:()=>Jw});async function Ac(e,{file:t}={}){let n=t||ne(e,Tc),s;try{s=await Ce(n,"utf8")}catch(o){if(o&&o.code==="ENOENT")return null;throw o}try{return Mo(s)}catch(o){throw new Error(`Invalid ${Tc} at ${n}: ${o&&o.message?o.message:o}`)}}async function YC(e,t){let n;if(Array.isArray(e))n=e;else{let o=Gt(t,String(e));n=(await Ce(o,"utf8")).split(`
106
- `)}let s=[];for(let o of n){let r=String(o).trim();!r||r.startsWith("#")||s.push(Gt(t,r))}return s}async function Jw(e,{configDir:t}={}){let n=e||{},s=t||process.cwd(),o={};if(n.repositories!==void 0&&(o.repositories=await YC(n.repositories,s)),n.out_root!==void 0&&(o.outRoot=Gt(s,String(n.out_root))),n.graph_file!==void 0&&(o.graphFile=Gt(s,String(n.graph_file))),n.graph_files!==void 0){let $=Array.isArray(n.graph_files)?n.graph_files:[n.graph_files];o.graphFiles=$.map(E=>Gt(s,String(E)))}let r=n.graph||{};r.read_only!==void 0&&(o.graph={readOnly:r.read_only});let i=n.corpus||{};i.tier!==void 0&&(o.corpus={tier:i.tier});let a=n.seed||{},c={};a.enabled!==void 0&&(c.enabled=a.enabled),a.limit!==void 0&&(c.limit=a.limit),a.capture_unknown_context!==void 0&&(c.captureUnknownContext=a.capture_unknown_context),a.unknown_context_limit!==void 0&&(c.unknownContextLimit=a.unknown_context_limit),Object.keys(c).length&&(o.seed=c),n.extensions!==void 0&&(o.extensions=n.extensions),n.bias!==void 0&&(o.bias=n.bias),n.games!==void 0&&(o.games=n.games),n.planning!==void 0&&(o.planning=n.planning),n.research!==void 0&&(o.research=n.research),n.news!==void 0&&(o.news=n.news),n.discourse!==void 0&&(o.discourse=n.discourse),n.recognition!==void 0&&(o.recognition=n.recognition),n.reasoning!==void 0&&(o.reasoning=n.reasoning);let l=n.index||{},u={};l.languages!==void 0&&(u.languages=l.languages),l.exclude!==void 0&&(u.exclude=l.exclude),l.secret_exclude!==void 0&&(u.secretExclude=l.secret_exclude),l.history_depth!==void 0&&(u.historyDepth=l.history_depth),l.include_text!==void 0&&(u.includeText=l.include_text),l.include_structure!==void 0&&(u.includeStructure=l.include_structure),l.respect_gitignore!==void 0&&(u.respectGitignore=l.respect_gitignore),l.markdown_sections!==void 0&&(u.markdownSections=l.markdown_sections),l.vue!==void 0&&(u.vue=l.vue),Object.keys(u).length&&(o.index=u);let d=n.tune||{},p={};d.score_gap_k!==void 0&&(p.scoreGapK=d.score_gap_k),d.literal_mention!==void 0&&(p.literalMention=d.literal_mention),d.demote_non_prod!==void 0&&(p.demoteNonProd=d.demote_non_prod),d.call_adjacency!==void 0&&(p.callAdjacency=d.call_adjacency),d.impl_of_interface!==void 0&&(p.implOfInterface=d.impl_of_interface),d.beam_search!==void 0&&(p.beamSearch=d.beam_search),d.beam_width!==void 0&&(p.beamWidth=d.beam_width),d.prose_layers!==void 0&&(p.proseLayers=d.prose_layers);let f=d.expansion||{},m={};f.strategy!==void 0&&(m.strategy=f.strategy),f.nodes!==void 0&&(m.nodes=f.nodes),f.q!==void 0&&(m.q=f.q),f.depth!==void 0&&(m.depth=f.depth),Object.keys(m).length&&(p.expansion=m),Object.keys(p).length&&(o.tune=p);let h=n.telemetry||{};h.enabled!==void 0&&(o.telemetry={enabled:h.enabled});let g=n.memory||{},b={};g.retention_versions!==void 0&&(b.retentionVersions=g.retention_versions),g.backend!==void 0&&(b.backend=g.backend),Object.keys(b).length&&(o.memory=b);let y=[];for(let[$,E]of XC)n[$]&&n[$][E]!==void 0&&y.push(`${$}.${E}`);return o.unwired=y,o}function _c(e,t="",n={}){for(let[s,o]of Object.entries(e||{})){if(o==null)continue;let r=t?`${t}.${s}`:s;Array.isArray(o)||typeof o!="object"?n[r]=o:_c(o,r,n)}return n}function Qw({args:e={},toml:t=null,defaults:n={}}={}){let s=_c(n),o=null;if(t){let{unwired:u,...d}=t;o=d}let r=o?_c(o):{},i=_c(e),a=[...new Set([...Object.keys(s),...Object.keys(r),...Object.keys(i)])].sort(),c={},l={};for(let u of a)u in i?(c[u]=i[u],l[u]="arg"):u in r?(c[u]=r[u],l[u]="tmct.toml"):(c[u]=s[u],l[u]="default");return{effective:c,sources:l}}var Tc,XC,Oi=M(()=>{Lt();Je();Rc();Tc="tmct.toml";XC=[["index","include_text"],["index","include_structure"],["index","respect_gitignore"],["index","markdown_sections"],["index","vue"]]});var Ms={};Nt(Ms,{CANONICALISED_FROM_PROP:()=>Tf,CAPABLE_OF_PREDICATE:()=>oO,CHAIN_KEEP_DEPTH:()=>Sw,CHAIN_ROLLUP_THRESHOLD:()=>dc,CREATED_AT_PROP:()=>lt,DEFAULT_RETENTION:()=>vf,FACT_CLASS:()=>Et,GROUP_ROLLUP_THRESHOLD:()=>xw,HAS_A_PREDICATE:()=>Mr,IN_REPLY_TO_PROP:()=>_f,MEMORY_DIR_REL:()=>Ir,MEMORY_GRAPH_REL:()=>Sf,MEMORY_MANIFEST_REL:()=>$y,MEMORY_SESSION_CLASS:()=>kf,MULTI_VALUED_PREDICATES:()=>rO,NODE_ID_REL:()=>Nf,OPERATOR_SOURCE_ID:()=>Cc,RETRACTED_AT_PROP:()=>gc,RETRACTED_COUNT_PROP:()=>ef,RETRACTED_RECORD_IDS_PROP:()=>hc,RETRACTION_CLASS:()=>bn,RETRACTION_PREDICATE:()=>mc,ROLLUP_COUNT_PROP:()=>ki,ROLLUP_EARLIEST_PROP:()=>ts,ROLLUP_KEEP_PER_TYPE:()=>Ew,ROLLUP_LATEST_PROP:()=>ns,ROLLUP_PRIOR_PROP:()=>_r,ROLLUP_RECORD_IDS_PROP:()=>ji,ROLLUP_SOURCE_IDS_PROP:()=>Rr,RULE_CLASS:()=>Nr,RULE_KIND_ACTION_CONSTRAINT:()=>Uf,RULE_KIND_ACTION_EFFECT:()=>Bi,RULE_KIND_ACTION_PRECOND:()=>Mc,RULE_KIND_ACTION_SIGNATURE:()=>zf,RULE_KIND_COMPOSE2:()=>zi,RULE_KIND_FILTER:()=>Ui,RULE_KIND_PROP:()=>Pr,RULE_KIND_RECURSIVE:()=>Df,SAID_IN_SESSION_PROP:()=>Rf,SOURCE_CLASS:()=>Or,SOURCE_RELIABILITY_PROP:()=>ny,STATED_BY_PROP:()=>_n,SYLLOGISE_STATE_REL:()=>Of,UPDATED_AT_PROP:()=>Ks,UTTERANCE_CLASS:()=>jf,admittedNodes:()=>vc,appendCanonicalisedFromEdges:()=>WI,appendFact:()=>Oy,appendFacts:()=>as,appendRetractions:()=>eO,appendRule:()=>Dc,appendUtterance:()=>BI,appendUtterances:()=>Ry,applySeedPayload:()=>ry,attachFactHeads:()=>py,chainRollupIdFor:()=>Kd,cloneMemoryPayload:()=>iy,closeSqliteMemoryStore:()=>by,createInMemoryStore:()=>Fi,createSqliteMemoryStore:()=>gy,emptyMemory:()=>Mi,factGroupId:()=>Yt,factHeadsOf:()=>my,factIdForTriple:()=>ve,factRecordIdForTag:()=>tI,factRecordIdsFor:()=>Do,findContradictions:()=>My,findRuleByName:()=>Bf,findRulesByName:()=>JI,headRollupIdFor:()=>qd,isChainRollupId:()=>Tr,isHeadRollupId:()=>so,isMemoryOrSqliteHandle:()=>Cf,isRetractionId:()=>nf,isRollupId:()=>fc,loadMemory:()=>pt,loadNodeId:()=>AI,loadSyllogiseState:()=>_I,normFactPredicate:()=>Zn,normFactTerm:()=>q,openConfiguredMemoryBackend:()=>io,openExistingMemoryBackend:()=>fI,openMemoryBackend:()=>If,peersToConvince:()=>cf,provSourceClassFor:()=>OI,provenanceTagToSource:()=>Pn,readFactRows:()=>bt,readObjectSupersessions:()=>lI,readOnlyMemorySnapshot:()=>pI,readRetractions:()=>ZI,readRuleRows:()=>zc,removeFacts:()=>Py,resolveMemoryGraphFile:()=>Ni,resolveRelationChase:()=>Wf,resolveRelationChaseReverse:()=>Ly,retirableRetractions:()=>tO,retireRetractions:()=>nO,retractedAtOf:()=>Lo,retractedRecordIds:()=>No,retractionFromWire:()=>$c,retractionIdFor:()=>tf,retractionScopeOf:()=>sf,retractionWireFact:()=>yc,saveNodeId:()=>CI,saveSyllogiseState:()=>TI,snapshotMemory:()=>EI,stableRecordIds:()=>xc});function Mi(){return{generated_at:"",memory:!0,prefixes:{owl:"http://www.w3.org/2002/07/owl#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",mgx:"urn:tmct:mgx#",mgxneg:"urn:tmct:mgxneg#"},vocabulary:ZC.map(e=>({...e})),classes:[],objectProperties:[],individuals:[],proseIndex:{}}}function Ni(e,t=null){if(ro(e)||rs(e))throw new Error("resolveMemoryGraphFile: dir is a memory/sqlite handle, not a file path (Backend A only)");return t===null?ne(e,Sf):ne(e,Ir,`graph.v${t}.json`)}function ro(e){return!!e&&typeof e=="object"&&e.backend===Af}function rs(e){return!!e&&typeof e=="object"&&e.backend===oy}function Cf(e){return ro(e)||rs(e)}function Fi(){return{backend:Af,payload:Mi()}}function ry(e,t){t&&(e.payload={...e.payload,...t})}function iy(e){if(!e)return null;try{return structuredClone(e)}catch{return JSON.parse(JSON.stringify(e))}}function ay(e){for(let t of String(e||"").split(" | ")){if(!t)continue;let n=Pf(Pn(t));if(n)return n}return{id:Os,type:""}}function Yt(e){let t=String(e||""),n=t.indexOf("@");return n<0?t:t.slice(0,n)}function tI(e,t){return`${e}@${cy(t).id}`}function cy(e){return Pf(Pn(e))||{id:Os,type:""}}function ly(e){let t=new Map;for(let n of String(e||"").split(" | ")){let s=n.trim();if(!s)continue;let{id:o,type:r}=cy(s),i=t.get(o)||{sourceId:o,sourceType:r,tags:[]};i.tags.includes(s)||i.tags.push(s),t.set(o,i)}return t.size||t.set(Os,{sourceId:Os,sourceType:"",tags:[]}),[...t.values()]}function yf(e,t=Math.max){let n="",s=null;for(let o of e||[]){let r=Pn(o)?.createdAt||"",i=Date.parse(r);Number.isFinite(i)&&(s===null||t(i,s)===i)&&(n=r,s=i)}return n}function Lr(e,t="",n=Math.max){return yf(e,n)||(Number.isFinite(Date.parse(t))?String(t):"")}function nI(e,t){let n=Date.parse(e.assertedAt),s=Date.parse(t.assertedAt);return!Number.isFinite(n)||!Number.isFinite(s)?!1:n>s?!0:n===s&&!!e.observedAt&&!t.observedAt}function uy(e,t){let n=i=>(e.attributes||[]).find(a=>a?.prop===i)?.value||"",s=ay(n("mgx:factProvenance")),o=n(Di).split(" ").filter(Boolean)[0]||null,r=Ri(e.id);return[e.id,Yt(e.id),n("rdf:subject"),n("rdf:predicate"),n("rdf:object"),n(Fo)||s.id,r||s.type,Number(n(r?_r:cr))||0,n(lt),n(Li)||null,o,t]}function sI(e){if(e.prepare("SELECT id FROM facts LIMIT 1").get()||!e.prepare("SELECT id FROM individuals WHERE class = ? LIMIT 1").get(Et))return;let t=e.prepare(dy);e.exec("BEGIN IMMEDIATE");try{for(let n of e.prepare("SELECT json FROM individuals WHERE class = ?").all(Et))t.run(...uy(JSON.parse(n.json),n.json));e.exec("COMMIT")}catch(n){throw e.exec("ROLLBACK"),n}}function oI(e){return(e||[]).map(t=>({sourceId:t.sourceId||"",sourceType:t.sourceType||"",ownTrust:t.ownTrust,assertedAt:t.assertedAt||""}))}function py(e,t){return e&&t&&(e[fy]=t),e}function iI(e){let t=new Map;for(let n of e.prepare("SELECT triple_hash, trust_base, inputs_json FROM fact_heads").all())t.set(n.triple_hash,{trustBase:n.trust_base,inputs:JSON.parse(n.inputs_json)});return t}function hy(e,t,n,s){let o=e.prepare(rI),r=e.prepare("DELETE FROM fact_heads WHERE triple_hash = ?"),i=Ns();for(let a of n){let c=t.groups.get(a);if(!c?.length){r.run(a),s?.delete(a);continue}let l=oI(Vf(a,c,t).assertions),u=$h(l).score;o.run(a,u,JSON.stringify(l),i),s?.set(a,{trustBase:u,inputs:l})}}function aI(e){let t=e.db;if(t.prepare("SELECT triple_hash FROM fact_heads LIMIT 1").get()||!t.prepare("SELECT id FROM individuals WHERE class = ? LIMIT 1").get(Et))return;let n=Gf(wy(e));t.exec("BEGIN IMMEDIATE");try{hy(t,n,n.groups.keys(),null),t.exec("COMMIT")}catch(s){throw t.exec("ROLLBACK"),s}}function cI(e,t,n){let s=e.prepare("SELECT ord, to_id FROM fact_object_supersessions WHERE subject = ? AND predicate = ? ORDER BY ord DESC LIMIT 1"),o=e.prepare("INSERT INTO fact_object_supersessions(subject, predicate, ord, from_id, to_id, recorded_at) VALUES (?, ?, ?, ?, ?, ?)"),r=Ns();for(let i of n){let[a,c]=i.split("\0");if(lc(c)!==Si)continue;let l=t.groupsByPair.get(i)||[];if(l.length<2)continue;let u=l.map(f=>{let m=Vf(f,t.groups.get(f),t);return m.trust=ja(m.assertions).score,m});if(new Set(u.map(f=>f.object)).size<2)continue;let d=Hd(u,Si)?.winner?.id;if(!d)continue;let p=s.get(a,c);p?.to_id!==d&&o.run(a,c,(p?.ord??-1)+1,p?.to_id||"",d,r)}}function lI(e,{subject:t,predicate:n}={}){if(!rs(e))return[];let s=t&&n?" WHERE subject = ? AND predicate = ?":"",o=s?[t,n]:[];return e.db.prepare(`SELECT subject, predicate, ord, from_id, to_id, recorded_at FROM fact_object_supersessions${s} ORDER BY subject, predicate, ord`).all(...o).map(r=>({subject:r.subject,predicate:r.predicate,ord:r.ord,fromId:r.from_id,toId:r.to_id,recordedAt:r.recorded_at}))}function dI(){if(ey)return;ey=!0;let e=process.listeners("warning").slice();process.removeAllListeners("warning"),process.on("warning",t=>{if(!(t?.name==="ExperimentalWarning"&&/sqlite/i.test(String(t?.message))))if(e.length)for(let n of e)n(t);else console.error(t.stack||String(t))})}async function gy(e){dI();let{DatabaseSync:t}=await Promise.resolve().then(()=>(Ww(),Bw)),n=new t(e);n.exec("PRAGMA journal_mode = WAL"),n.exec("PRAGMA synchronous = NORMAL"),n.exec(eI),sI(n);let s={backend:oy,db:n,dbPath:e};return aI(s),s}function by(e){rs(e)&&e.db.close()}async function If(e,t){if(t===Af)return{dir:Fi(),close:async()=>{}};let n=ne(e,".tmct","memory","graph.sqlite"),s=r=>ou(r).then(()=>!0,()=>!1);!await s(n)&&await s(ne(e,Sf))&&process.stderr.write(`found .tmct/memory/graph.json \u2014 the flat-file memory backend is retired; starting a fresh sqlite store (the old file is left untouched)
107
- `),await Vn(ye(n),{recursive:!0});let o=await gy(n);return{dir:o,close:async()=>by(o)}}async function fI(e,t=""){if(!e||typeof e!="string")return null;let n=ne(e,".tmct","memory","graph.sqlite");try{await ou(n)}catch{return null}return If(e,t)}async function pI(e){if(!e)return null;let t=Fi();return ry(t,iy(await pt(e))),t}async function io(e,t=process.env){let n=String(t?.TMCT_MEMORY_BACKEND||"").trim().toLowerCase();if(!n)try{let{loadTomlConfig:s}=await Promise.resolve().then(()=>(Oi(),hf));n=String((await s(e))?.memory?.backend||"").trim().toLowerCase()}catch{n=""}return If(e,n)}function mI(e){let t=e.db.prepare("PRAGMA data_version").get()?.data_version;return e.cachedPayload&&e.cachedDataVersion!==t&&(e.cachedPayload=null),e.cachedPayload||(e.cachedPayload=wy(e),e.cachedFactHeads=iI(e.db),e.cachedDataVersion=t),py(Bn(e.cachedPayload),e.cachedFactHeads)}function wy(e){let t=e.db,n=Mi(),s=(a,c)=>{let l=t.prepare("SELECT v FROM meta WHERE k = ?").get(a);return l?JSON.parse(l.v):c},o=t.prepare("SELECT json FROM individuals ORDER BY ord").all().map(a=>JSON.parse(a.json)),r=t.prepare("SELECT subject, object, subject_label, object_label, extra FROM edges WHERE prop = ? ORDER BY rowid"),i=t.prepare("SELECT prop, predicate, count FROM relations ORDER BY ord").all().map(a=>({predicate:a.predicate,prop:a.prop,count:a.count,examples:r.all(a.prop).map(c=>{let l={subject:c.subject,object:c.object,subjectLabel:c.subject_label,objectLabel:c.object_label};return c.extra&&Object.assign(l,JSON.parse(c.extra)),l})}));return{generated_at:s("generated_at",n.generated_at),memory:s("memory",n.memory),prefixes:s("prefixes",n.prefixes),vocabulary:s("vocabulary",n.vocabulary),classes:s("classes",n.classes),objectProperties:i,individuals:o,proseIndex:s("proseIndex",n.proseIndex)}}function hI(e,t){let n=Bn(t),s=e.individuals.findIndex(o=>o?.id===t.id);s>=0?e.individuals[s]=n:e.individuals.push(n)}function gI(e,t){e.individuals=e.individuals.filter(n=>t.has(n?.id))}function bI(e,t){let n=e.objectProperties.find(s=>s?.prop===t);return n||(n={predicate:null,prop:t,count:0,examples:[]},e.objectProperties.push(n)),n}function wI(e,t,n){let s=`${t.subject}\0${t.object}`;e.examples=e.examples.filter(r=>`${r.subject}\0${r.object}`!==s);let o={subject:t.subject,object:t.object,subjectLabel:t.subjectLabel??null,objectLabel:t.objectLabel??null};n.length&&Object.assign(o,Bn(Object.fromEntries(n.map(r=>[r,t[r]])))),e.examples.push(o)}function yI(e,t){e.examples=e.examples.filter(n=>t.has(`${n.subject}\0${n.object}`))}function $I(e,t){e.objectProperties=e.objectProperties.filter(n=>t.has(n?.prop))}function vI(e,t){let n=e.db,s=Mi(),o=e.cachedPayload||null;n.exec("BEGIN IMMEDIATE");try{let r=n.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)");r.run("generated_at",JSON.stringify(t.generated_at??s.generated_at)),r.run("memory",JSON.stringify(t.memory??s.memory)),r.run("prefixes",JSON.stringify(t.prefixes??s.prefixes)),r.run("vocabulary",JSON.stringify(t.vocabulary??s.vocabulary)),r.run("classes",JSON.stringify(t.classes??s.classes)),r.run("proseIndex",JSON.stringify(t.proseIndex??s.proseIndex)),o&&(o.generated_at=Bn(t.generated_at??s.generated_at),o.memory=Bn(t.memory??s.memory),o.prefixes=Bn(t.prefixes??s.prefixes),o.vocabulary=Bn(t.vocabulary??s.vocabulary),o.classes=Bn(t.classes??s.classes),o.proseIndex=Bn(t.proseIndex??s.proseIndex));let i=n.prepare("SELECT ord, json FROM individuals WHERE id = ?"),c=n.prepare("SELECT COALESCE(MAX(ord), -1) AS m FROM individuals").get().m+1,l=n.prepare("INSERT OR REPLACE INTO individuals(id, ord, class, label, json) VALUES (?, ?, ?, ?, ?)"),u=n.prepare(dy),d=new Set,p=new Set,f=new Set;for(let x of t.individuals||[]){d.add(x.id);let R=JSON.stringify(x),w=i.get(x.id);if(w&&w.json===R)continue;let T=w?w.ord:c++;l.run(x.id,T,x.class??null,x.label??null,R),x.class===Et&&(u.run(...uy(x,R)),p.add(Yt(x.id)),f.add($f(Pi(x,"subject"),Pi(x,"predicate")))),o&&hI(o,x)}let m=n.prepare("DELETE FROM individuals WHERE id = ?"),h=n.prepare("DELETE FROM facts WHERE id = ?"),g=n.prepare("SELECT triple_hash, subject, predicate FROM facts WHERE id = ?");for(let x of n.prepare("SELECT id FROM individuals").all()){if(d.has(x.id))continue;let R=g.get(x.id);R&&(p.add(R.triple_hash),f.add($f(R.subject,R.predicate))),m.run(x.id),h.run(x.id)}o&&gI(o,d);let b=n.prepare("SELECT ord FROM relations WHERE prop = ?"),$=n.prepare("SELECT COALESCE(MAX(ord), -1) AS m FROM relations").get().m+1,E=n.prepare("INSERT OR REPLACE INTO relations(prop, ord, predicate, count) VALUES (?, ?, ?, ?)"),_=n.prepare("SELECT subject, object, subject_label, object_label, extra FROM edges WHERE prop = ?"),v=n.prepare("INSERT OR REPLACE INTO edges(prop, subject, object, subject_label, object_label, extra) VALUES (?, ?, ?, ?, ?, ?)"),S=n.prepare("DELETE FROM edges WHERE prop = ? AND subject = ? AND object = ?"),C=new Set;for(let x of t.objectProperties||[]){C.add(x.prop);let R=_.all(x.prop),w=new Map(R.map(P=>[`${P.subject}\0${P.object}`,P])),T=new Set,I=o?bI(o,x.prop):null;for(let P of x.examples||[]){let U=`${P.subject}\0${P.object}`;T.add(U);let H=Object.keys(P).filter(V=>!uI.has(V)),X=H.length?JSON.stringify(Object.fromEntries(H.map(V=>[V,P[V]]))):null,Q=w.get(U);Q&&(Q.subject_label??null)===(P.subjectLabel??null)&&(Q.object_label??null)===(P.objectLabel??null)&&(Q.extra??null)===(X??null)||(v.run(x.prop,P.subject,P.object,P.subjectLabel??null,P.objectLabel??null,X),I&&wI(I,P,H))}for(let P of w.keys()){if(T.has(P))continue;let[U,H]=P.split("\0");S.run(x.prop,U,H)}I&&yI(I,T);let j=Number.isFinite(x.count)?x.count:(x.examples||[]).length,k=b.get(x.prop)?.ord??$++;E.run(x.prop,k,x.predicate??null,j),I&&(I.predicate=x.predicate??null,I.count=j)}for(let x of n.prepare("SELECT prop FROM relations").all())C.has(x.prop)||(n.prepare("DELETE FROM edges WHERE prop = ?").run(x.prop),n.prepare("DELETE FROM relations WHERE prop = ?").run(x.prop));if(o&&$I(o,C),p.size){let x=Gf(t);hy(n,x,p,e.cachedFactHeads),cI(n,x,f)}n.exec("COMMIT")}catch(r){throw n.exec("ROLLBACK"),e.cachedPayload=void 0,e.cachedFactHeads=void 0,r}}async function yy(e,t){let n=`${e}.tmp-${process.pid}-${Math.random().toString(36).slice(2,10)}`;await er(n,t),await ha(n,e)}async function Nc(e,t){await yy(e,JSON.stringify(t))}async function EI(e,{retentionVersions:t}={}){if(Cf(e))throw new Error("snapshotMemory only supports the flat-JSON backend (Backend A) \u2014 a memory/sqlite handle has no on-disk graph.json to snapshot");let n=Ni(e),s;try{s=await Ce(n,"utf8")}catch(u){if(u?.code==="ENOENT")return{skipped:!0,version:null,prunedVersion:null};throw u}let o=xI(e),r;try{r=JSON.parse(await Ce(o,"utf8"))}catch(u){if(u?.code!=="ENOENT")throw u;r={version:0,retentionVersions:t??vf}}Number.isInteger(r.version)||(r.version=0),Number.isInteger(r.retentionVersions)||(r.retentionVersions=t??vf);let i=r.version,a=Ni(e,i);await Vn(ye(a),{recursive:!0}),await yy(a,s),r.version=i+1;let c=null,l=i-r.retentionVersions;if(l>=0)try{await ru(Ni(e,l)),c=l}catch(u){if(u?.code!=="ENOENT")throw u}return await Nc(o,r),{skipped:!1,version:i,prunedVersion:c}}async function pt(e){if(ro(e))return gf(e.payload);if(rs(e))return gf(mI(e));let t;try{t=await Ce(wf(e),"utf8")}catch(n){if(n?.code==="ENOENT")return Mi();throw n}return gf(JSON.parse(t))}function jI(e){if(!Array.isArray(e?.individuals))return e;let t=new Map;for(let s of e.individuals){if(s?.class!==Et||!SI.test(s.id||""))continue;let o=i=>(s.attributes||[]).find(a=>a?.key===i)?.value||"",r=Co(o("subject"),o("predicate"),o("object"));r!==s.id&&(t.set(s.id,r),s.id=r)}if(!t.size)return e;let n=s=>t.get(s)||s;for(let s of e.objectProperties||[])for(let o of s.examples||[])o&&(t.has(o.subject)&&(o.subject=t.get(o.subject)),t.has(o.object)&&(o.object=t.get(o.object)));for(let s of e.individuals){Array.isArray(s?.derived_from)&&s.derived_from.length&&(s.derived_from=s.derived_from.map(n));let o=(s?.attributes||[]).find(r=>r?.prop==="mgx:factJustification");o?.value&&(o.value=o.value.split(" | ").map(r=>r.split(" ").filter(Boolean).map(n).join(" ")).filter(Boolean).join(" | "))}return e}function kI(e){if(!Array.isArray(e?.individuals))return e;let t=(e.objectProperties||[]).find(c=>c?.prop===_n),n=new Map;for(let c of t?.examples||[]){if(!c?.subject)continue;let l=n.get(c.subject);l?l.push(c):n.set(c.subject,[c])}let s=new Set,o=new Map,r=[],i=[],a=[];for(let c of e.individuals){if(c?.class!==Et||String(c.id||"").includes("@")){a.push(c);continue}let l=$=>(c.attributes||[]).find(E=>E?.prop===$)?.value||"",u=l("rdf:subject"),d=l("rdf:predicate"),p=l("rdf:object");if(!u||!d||!p){a.push(c);continue}let f=Co(u,d,p),m=l(lt),h=l("mgx:factProvenance"),g=n.get(c.id)||[],b=h?ly(h):[];for(let $ of g)b.some(E=>E.sourceId===$.object)||b.push({sourceId:$.object,sourceType:"",tags:[]});b.length||b.push({sourceId:Os,sourceType:"",tags:[]});let y=[];for(let $ of b){let E={id:`${f}@${$.sourceId}`,label:c.label,class:Et,derived_from:Bn(c.derived_from)||[],mentions:Bn(c.mentions)||[],attributes:[{prop:"rdf:type",key:"type",value:"rdf:Statement"},{prop:"rdf:subject",key:"subject",value:u},{prop:"rdf:predicate",key:"predicate",value:d},{prop:"rdf:object",key:"object",value:p},{prop:lt,key:"createdAt",value:Lr($.tags,m,Math.min)||m||Ns()},{prop:Fo,key:"sourceId",value:$.sourceId},...$.tags.length?[{prop:"mgx:factProvenance",key:"provenance",value:$.tags.join(" | ")}]:[],...l("mgx:hasProseTokens")?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:l("mgx:hasProseTokens")}]:[],...l("mgx:factQuantifier")?[{prop:"mgx:factQuantifier",key:"quantifier",value:l("mgx:factQuantifier")}]:[],...$.sourceType==="entailed"&&l("mgx:factJustification")?[{prop:"mgx:factJustification",key:"justification",value:l("mgx:factJustification")}]:[]]};if(a.push(E),r.push(E),y.push(E.id),$.sourceId!==Os){let _=g.find(v=>v?.object===$.sourceId);i.push({..._||{},subject:E.id,object:$.sourceId,subjectLabel:E.label,objectLabel:Mf($.sourceId)})}}s.add(c.id),o.set(c.id,y)}if(!s.size)return e;t?(t.examples=(t.examples||[]).filter(c=>!s.has(c?.subject)),t.examples.push(...i),t.count=t.examples.length):i.length&&(e.objectProperties=e.objectProperties||[],e.objectProperties.push({predicate:"statedBy",prop:_n,count:i.length,examples:i}));for(let c of e.objectProperties||[]){if(c?.prop===_n||!c?.examples?.length)continue;let l=[];for(let u of c.examples){let d=s.has(u?.subject)?o.get(u.subject)||[]:[u?.subject],p=s.has(u?.object)?o.get(u.object)||[]:[u?.object];for(let f of d)for(let m of p)l.push({...u,subject:f,object:m})}c.examples=l,c.count=l.length}e.individuals=a,Ey(e);for(let c of r)Cr(e,c);return is(e),e}async function RI(e,t){if(ro(e)){e.payload=t;return}if(rs(e)){vI(e,t);return}await Vn(ye(wf(e)),{recursive:!0}),await Nc(wf(e),t)}async function _I(e){if(ro(e))return e.syllogiseState?structuredClone(e.syllogiseState):null;if(rs(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(vy);return t?.v?JSON.parse(t.v):null}try{return JSON.parse(await Ce(ne(e,Of),"utf8"))}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function TI(e,t){if(ro(e)){e.syllogiseState=structuredClone(t);return}if(rs(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(vy,JSON.stringify(t));return}let n=ne(e,Of);await Vn(ye(n),{recursive:!0}),await Nc(n,t)}async function AI(e){if(ro(e))return e.nodeId||null;if(rs(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(xy);return t?.v&&JSON.parse(t.v).nodeId||null}try{return JSON.parse(await Ce(ne(e,Nf),"utf8")).nodeId||null}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function CI(e,t){if(ro(e)){e.nodeId=t;return}if(rs(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(xy,JSON.stringify({nodeId:t}));return}let n=ne(e,Nf);await Vn(ye(n),{recursive:!0}),await Nc(n,{nodeId:t})}function Ey(e){let t=new Map,n=new Map,s=new Map,o=new Map,r=new Map;for(let a of e.individuals||[])if(a?.id&&(t.set(a.id,a),a.class===Or&&n.set(a.id,a),a.class===bn&&Ef(r,a),a.class===Et)){let c=Yt(a.id),l=o.get(c);l?l.push(a.id):o.set(c,[a.id])}let i=(e.objectProperties||[]).find(a=>a?.prop===_n);for(let a of i?.examples||[]){if(!a?.subject)continue;let c=s.get(a.subject);c?c.push(a.object):s.set(a.subject,[a.object])}return e[xf]={individualsById:t,sourcesById:n,statedByBySubject:s,factRecordsByGroup:o,retractionsByGroup:r},e[xf]}function Ef(e,t){let n=Yt(t.id),s=(e.get(n)||[]).filter(o=>o.id!==t.id);s.push(t),e.set(n,s)}function II(e,t){let n=Xt(e);return n?n.retractionsByGroup.get(t)||[]:(e?.individuals||[]).filter(s=>s?.class===bn&&Yt(s.id)===t)}async function Ps(e,t){let n=await pt(e);Ey(n);let s=await t(n)??n;return MI(s),DI(s),s.proseIndex=ch(s.individuals),await RI(e,s),s}function Lf(e,t){return e?.attributes?.find(n=>n?.prop===lt)?.value||t||Ns()}function Tn(e,t,n,s){e.attributes=(e.attributes||[]).filter(o=>o?.prop!==t),e.attributes.push({prop:t,key:n,value:s})}function Pf(e){switch(e?.kind){case"operator":return{id:e.sessionId?`${Cc}:${e.sessionId}`:Cc,type:"operator"};case"teach":return{id:e.sessionId?`${bf}:${e.sessionId}`:bf,type:"teach"};case"teachNode":return{id:`${sy}:${e.nodeId}`,type:"teach"};case"provider":return{id:`src:provider:${e.name}`,type:"provider"};case"corpus":return{id:`src:corpus:${e.name}`,type:"corpus"};case"corpusWeak":return{id:`src:corpus-weak:${e.name}`,type:"corpusWeak"};case"reference":return{id:`src:reference:${e.pack}:${e.article}`,type:"reference"};case"referenceLive":return{id:`src:reference:${e.pack}:${e.article}`,type:"referenceLive"};case"extracted":return{id:`src:extracted:${e.name}`,type:"extracted"};case"optimisticExtract":return{id:`src:optimistic-extract:${e.name}`,type:"optimisticExtract"};case"web":return{id:`src:learned:web:${vi(String(e.url||""))}`,type:"web",url:String(e.url||"")};case"entailed":return{id:`src:entailed:${e.rule}`,type:"entailed",rule:String(e.rule||"")};default:return null}}function OI(e){return hu[e]||null}function NI(e,t,n){let s=Pf(t);if(!s)return null;let o=Xt(e),r=o?o.individualsById.get(s.id):e.individuals.find(l=>l?.id===s.id),i=Lf(r,t?.createdAt||n),a={id:s.id,label:Mf(s.id),class:Or,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:"mgx:sourceType",key:"sourceType",value:s.type},{prop:lt,key:"createdAt",value:i},...s.url?[{prop:"mgx:sourceUrl",key:"sourceUrl",value:s.url}]:[],...s.rule?[{prop:"mgx:sourceRule",key:"sourceRule",value:s.rule}]:[]]},c=Ls(e,a);return o&&o.sourcesById.set(s.id,c),s.id}function Pc(e){let t=Xt(e),n={};if(t){for(let[s,o]of t.sourcesById)n[s]=o;return n}for(let s of e.individuals)s?.class===Or&&(n[s.id]=s);return n}function Sy(e,t){let n=Xt(e);return n?(n.statedByBySubject.get(t)||[]).slice():(e.objectProperties.find(o=>o?.prop===_n)?.examples||[]).filter(o=>o?.subject===t).map(o=>o.object)}function LI(e,t,n=Date.now(),s={}){let o=Sy(e,t.id),r=(t.attributes||[]).find(c=>c?.prop===lt)?.value||"",{score:i,inputs:a}=yh({sourceIds:o,createdAt:r},Pc(e),{now:n,...Array.isArray(s?.premiseTrusts)?{premiseTrusts:s.premiseTrusts}:{},...typeof s?.ruleConfidence=="number"?{ruleConfidence:s.ruleConfidence}:{}});Tn(t,cr,"trustScore",String(i)),Tn(t,Ea,"trustInputs",JSON.stringify(a)),Tn(t,Ks,"updatedAt",new Date(n).toISOString())}function PI(e,t,n=Date.now(),s={}){let[o]=Sy(e,t.id),r=o?Pc(e)[o]:null,i=(r?.attributes||[]).find(l=>l?.prop==="mgx:sourceType")?.value||"",a=Sa(i,r);if(i==="entailed"&&Array.isArray(s?.premiseTrusts)&&s.premiseTrusts.length){let l=typeof s.ruleConfidence=="number"?s.ruleConfidence:1;a=Math.max(0,Math.min(1,Math.min(...s.premiseTrusts)*l))}let c=(t.attributes||[]).find(l=>l?.prop===lt)?.value||"";Tn(t,cr,"trustScore",String(a)),Tn(t,Ea,"trustInputs",JSON.stringify({sourceType:i,sourceId:o||"",createdAt:c})),Tn(t,Ks,"updatedAt",new Date(n).toISOString())}function jy(e,t,n,s){t?.class===Et?PI(e,t,n,s):LI(e,t,n,s)}function Cr(e,t,n=Date.now(),s={}){let o=(t.attributes||[]).find(i=>i?.prop==="mgx:factProvenance")?.value||"",r=(t.attributes||[]).find(i=>i?.prop===lt)?.value||new Date(n).toISOString();for(let i of o.split(" | ").filter(Boolean)){let a=Pn(i);if(!a)continue;let c=NI(e,a,r);c&&Oc(e,{predicate:"statedBy",prop:_n},{subject:t.id,object:c,subjectLabel:t.label,objectLabel:Mf(c)})}jy(e,t,n,s)}function MI(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=e.objectProperties.find(r=>r?.prop===_n),n=new Set((t?.examples||[]).map(r=>r.subject)),s=!1,o=Date.now();for(let r of e.individuals)r?.class!==Et||n.has(r.id)||!(r.attributes||[]).find(a=>a?.prop==="mgx:factProvenance")?.value||(Cr(e,r,o),s=!0);s&&is(e)}function DI(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=bt(e),n=new Set;for(let a of My(e))for(let c of a)n.add(c.id);let s=new Map;for(let a of t)for(let c of a.sourceIds){if(!FI(c))continue;let l=s.get(c)||{factsAsserted:0,factsContradicted:0};l.factsAsserted+=1,n.has(a.id)&&(l.factsContradicted+=1),s.set(c,l)}if(!s.size)return;let o=Xt(e);for(let[a,c]of s){let l=o?o.individualsById.get(a):e.individuals.find(u=>u?.id===a);l&&(Tn(l,ny,"sourceReliability",String(vh(c))),Tn(l,Ks,"updatedAt",new Date().toISOString()))}let r=e.objectProperties.find(a=>a?.prop===_n),i=new Set;for(let a of r?.examples||[])s.has(a?.object)&&i.add(a.subject);for(let a of i){let c=o?o.individualsById.get(a):e.individuals.find(l=>l?.id===a);c&&jy(e,c)}}function zI(e,t,n){if(!fc(n?.id))return n;let s=Ri(n.id);if(!s)return Qd(t,n);let o=Pc(e);return Qd(t,n,{priorFor:r=>Sa(s,o[r])})}function ty(e,t,n){return n?.class===bn?Mw(t,n):zI(e,t,n)}function Ls(e,t){let n=Xt(e);if(n){let o=n.individualsById.get(t.id);if(o)return Object.assign(o,ty(e,o,t)),o.class===bn&&Ef(n.retractionsByGroup,o),o;if(e.individuals.push(t),n.individualsById.set(t.id,t),t.class===bn&&Ef(n.retractionsByGroup,t),t.class===Et){let r=Yt(t.id),i=n.factRecordsByGroup.get(r);i?i.push(t.id):n.factRecordsByGroup.set(r,[t.id])}return t}let s=e.individuals.findIndex(o=>o?.id===t.id);return s>=0?(e.individuals[s]=ty(e,e.individuals[s],t),e.individuals[s]):(e.individuals.push(t),t)}function Oc(e,{predicate:t,prop:n},s){let o=e.objectProperties.find(c=>c?.prop===n);o||(o={predicate:t,prop:n,count:0,examples:[]},e.objectProperties.push(o));let r=n===_n?Xt(e):null;if(r){let c=r.statedByBySubject.get(s.subject);if(!c||!c.includes(s.object)){o.examples.push({...s,createdAt:s.createdAt||Ns()}),o.count=o.examples.length,c?c.push(s.object):r.statedByBySubject.set(s.subject,[s.object]);return}}let a=(o.examples||[]).find(c=>c?.subject===s.subject&&c?.object===s.object)?.createdAt||s.createdAt||Ns();if(o.examples=(o.examples||[]).filter(c=>!(c?.subject===s.subject&&c?.object===s.object)),o.examples.push({...s,createdAt:a}),o.count=o.examples.length,r){let c=r.statedByBySubject.get(s.subject)||[];c.includes(s.object)||c.push(s.object),r.statedByBySubject.set(s.subject,c)}}function is(e){let t=[kf,jf,Et,Or,Nr];e.classes=(e.classes||[]).filter(n=>!t.includes(n?.name));for(let n of t){let s=e.individuals.filter(o=>o?.class===n);s.length&&e.classes.push({name:n,count:s.length,sample:s.slice(0,3).map(o=>o.label)})}}function UI(e,t,n=""){let s=`session:${t}`;return e.individuals.some(o=>o?.id===s)||e.individuals.push({id:s,label:String(t).slice(0,8),class:kf,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:lt,key:"createdAt",value:n||Ns()},...n?[{prop:"mgx:sessionStarted",key:"started",value:n}]:[]]}),s}function ky(e,{role:t,text:n,ts:s,sessionId:o,sessionStarted:r="",parsed:i=null,replyTo:a=null,createdAt:c=""}){if(!QC.has(t))throw new Error(`utterance role must be "visitor" or "tmct", got ${JSON.stringify(t)}`);if(!o)throw new Error("utterance needs a sessionId");let l=String(s||""),u=As(n),d=`utt:${o}#${l}#${t}`,p=Lc(u)||(t==="visitor"?"a-visitor-said":"a-tmct-said"),f=xa({doc:u}),m=e.individuals.find(y=>y?.id===d),h=Lf(m,c||l),g={id:d,label:p,class:jf,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:"mgx:utteranceRole",key:"role",value:t},{prop:"mgx:utteranceText",key:"text",value:u},{prop:"mgx:utteranceTs",key:"ts",value:l},{prop:lt,key:"createdAt",value:h},...i!=null?[{prop:"mgx:utteranceParsed",key:"parsed",value:JSON.stringify(i)}]:[],...f.length?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:f.join(" ")}]:[]]};Ls(e,g);let b=UI(e,o,r);if(Oc(e,{predicate:"saidInSession",prop:Rf},{subject:d,object:b,subjectLabel:p,objectLabel:String(o).slice(0,8)}),a){let y=e.individuals.find($=>$?.id===a);y&&Oc(e,{predicate:"inReplyTo",prop:_f},{subject:d,object:a,subjectLabel:p,objectLabel:y.label})}return l&&l>String(e.generated_at||"")&&(e.generated_at=l),d}async function BI(e,t){let n;return await Ps(e,s=>{n=ky(s,t),is(s)}),{id:n}}async function Ry(e,t){let n=[];return t?.length?(await Ps(e,s=>{for(let o of t)n.push(ky(s,o));is(s)}),{ids:n}):{ids:n}}async function WI(e,t){t?.length&&await Ps(e,n=>{for(let s of t)for(let o of Do(n,s.factId))Oc(n,{predicate:"canonicalisedFrom",prop:Tf},{subject:o,object:s.uttId,subjectLabel:s.factLabel,objectLabel:s.uttLabel})})}function Do(e,t){let n=Xt(e);return n?(n.factRecordsByGroup.get(t)||[]).slice():(e?.individuals||[]).filter(s=>s?.class===Et&&Yt(s.id)===t).map(s=>s.id)}function _y(e,t,n,s=""){let o=ly(n);if(o.length===1&&o[0].sourceId===Os&&Do(e,t).length)return[];let r=II(e,t);if(r.length&&(o=o.filter(a=>!wc(r,`${t}@${a.sourceId}`,Lr(a.tags,s))),!o.length))return o;let i=GI(e,t);return i.length?o.filter(a=>!Ow(i,a.sourceId)):o}function GI(e,t){let n=Xt(e),s=n?n.factRecordsByGroup.get(t):Do(e,t),o=[];for(let r of s||[]){if(!so(r))continue;let i=oo(e,r);i&&o.push(i)}return o}function Ty(e,t,{quantifier:n,environments:s}){let o=Do(e,t).map(i=>oo(e,i)).filter(i=>i&&!(i.attributes||[]).some(a=>a?.prop===Di)),r=new Set;if(s){let i=o.filter(a=>(a.attributes||[]).some(c=>c?.prop==="mgx:factJustification"));for(let a of i.length?i:o)Tn(a,"mgx:factJustification","justification",s.map(c=>c.join(" ")).join(" | ")),r.add(a.id)}if(n)for(let i of o)(i.attributes||[]).some(a=>a?.prop==="mgx:factQuantifier")||(Tn(i,"mgx:factQuantifier","quantifier",n),r.add(i.id));return[...r]}function VI(e){let t=0,n=(e.attributes||[]).find(s=>s?.prop===Ic)?.value||"";for(let s of n.split(" ").filter(Boolean)){let o=/#v([1-9][0-9]*)$/.exec(s);o&&(t=Math.max(t,Number(o[1])))}return t+1}function Ay(e,t){let{groupId:n,s,p:o,o:r,label:i,tokens:a,group:c,createdAt:l,observedAt:u,quantifier:d,environments:p}=t,f=`${n}@${c.sourceId}`,m=Xt(e),h=m?m.individualsById.get(f):e.individuals.find(R=>R?.id===f),g=R=>(h?.attributes||[]).find(w=>w?.prop===R)?.value||"",b=g("mgx:factProvenance").split(" | ").filter(Boolean),y={assertedAt:yf(c.tags),observedAt:u},$=null,E=c.tags,_=y.assertedAt||l||Ns(),v=u,S=[],C=d;if(h){let R={assertedAt:yf(b),observedAt:g(Li)};nI(y,R)?($={head:h,id:`${f}#v${VI(h)}`},S=[$.id]):(E=[...new Set([...b,...c.tags])],_=g(lt)||_,v=u||g(Li),S=g(Ic).split(" ").filter(Boolean)),C=d||g("mgx:factQuantifier")}return{candidate:{id:f,label:i,class:Et,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"rdf:Statement"},{prop:"rdf:subject",key:"subject",value:s},{prop:"rdf:predicate",key:"predicate",value:o},{prop:"rdf:object",key:"object",value:r},{prop:lt,key:"createdAt",value:_},{prop:Fo,key:"sourceId",value:c.sourceId},...E.length?[{prop:"mgx:factProvenance",key:"provenance",value:E.join(" | ")}]:[],...v?[{prop:Li,key:"observedAt",value:v}]:[],...a.length?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:a.join(" ")}]:[],...C?[{prop:"mgx:factQuantifier",key:"quantifier",value:C}]:[],...p?[{prop:"mgx:factJustification",key:"justification",value:p.map(R=>R.join(" ")).join(" | ")}]:[],...S.length?[{prop:Ic,key:"supersedes",value:S.join(" ")}]:[]]},demote:$}}function HI(e,t){let n=`${t}@${Os}`,s=Xt(e);if((s?!s.individualsById.has(n):!e.individuals.some(r=>r?.id===n))||(e.individuals=e.individuals.filter(r=>r?.id!==n),!s))return;s.individualsById.delete(n);let o=(s.factRecordsByGroup.get(t)||[]).filter(r=>r!==n);o.length?s.factRecordsByGroup.set(t,o):s.factRecordsByGroup.delete(t)}function Cy(e,{candidate:t,demote:n}){let s=[];if(t.id.endsWith(`@${Os}`)||HI(e,Yt(t.id)),n){let o={...n.head,id:n.id,attributes:(n.head.attributes||[]).map(r=>({...r}))};Tn(o,Di,"supersededBy",t.id),Ls(e,o),s.push(o.id)}return Ls(e,t),s.push(t.id),s}function oo(e,t){let n=Xt(e);return n?n.individualsById.get(t):e.individuals.find(s=>s?.id===t)}function Ff(e,t){let n=new Set(t);if(!n.size)return;e.individuals=(e.individuals||[]).filter(o=>!n.has(o?.id));for(let o of e.objectProperties||[]){let r=o.examples||[],i=r.filter(a=>!n.has(a?.subject)&&!n.has(a?.object));i.length!==r.length&&(o.examples=i,o.count=i.length)}let s=Xt(e);if(s)for(let o of n){s.individualsById.delete(o),s.statedByBySubject.delete(o);let r=Yt(o),i=(s.factRecordsByGroup.get(r)||[]).filter(a=>a!==o);i.length?s.factRecordsByGroup.set(r,i):s.factRecordsByGroup.delete(r)}}function Iy(e,t){let n=Xt(e),s=(n?n.factRecordsByGroup.get(t):Do(e,t))||[];if(s.length<8)return[];let o=new Map,r=new Map,i=new Map,a=new Map;for(let u of s.slice()){let d=oo(e,u);if(!d)continue;let p=y=>(d.attributes||[]).find($=>$?.prop===y)?.value||"";if(so(u)){i.set(Ri(u),d);continue}if(Tr(u)){a.set(p(Fo),d);continue}let f=p("mgx:factProvenance"),m=ay(f),h=f.split(" | ").filter(Boolean),g={id:u,sourceId:p(Fo)||m.id,assertedAt:Lr(h,p(lt)),record:d};if(p(Di)){let y=r.get(g.sourceId);y?y.push(g):r.set(g.sourceId,[g]);continue}if(!m.type)continue;let b=o.get(m.type);b?b.push(g):o.set(m.type,[g])}let c=Pc(e),l=[];for(let[u,d]of o){let p=Cw({groupId:t,sourceType:u,heads:d,existing:i.get(u)||null,priorFor:f=>Sa(u,c[f])});if(p){Ls(e,p.rollup),l.push(...p.absorbed);for(let f of p.absorbedSourceIds){for(let h of r.get(f)||[])l.push(h.id);r.delete(f);let m=a.get(f);m&&l.push(m.id),a.delete(f)}}}for(let[u,d]of r){let p=Iw({groupId:t,sourceId:u,leaves:d,existing:a.get(u)||null});if(!p)continue;Ls(e,p.rollup),l.push(...p.absorbed);let f=oo(e,p.rewire);f&&Tn(f,Ic,"supersedes",p.rollup.id)}return l}async function Oy(e,{subject:t,predicate:n,object:s,provenance:o="",createdAt:r="",observedAt:i="",quantifier:a="",premiseTrusts:c,ruleConfidence:l}={}){let u=q(t),d=Zn(n),p=q(s);if(!u||!d||!p)throw new Error("a fact needs subject, predicate and object");let f=Co(u,d,p),m=`${u} ${d} ${p}`,h=xa({doc:m}),g=As(a);return await Ps(e,async b=>{let y=_y(b,f,As(o),r);for(let $ of y.length?[]:Ty(b,f,{quantifier:g}))Cr(b,oo(b,$),void 0,{premiseTrusts:c,ruleConfidence:l});for(let $ of y){let E=Ay(b,{groupId:f,s:u,p:d,o:p,label:Lc(m),tokens:h,group:$,createdAt:r,observedAt:i,quantifier:g});await uf(E.candidate);for(let _ of Cy(b,E))Cr(b,oo(b,_),void 0,_===E.candidate.id?{premiseTrusts:c,ruleConfidence:l}:void 0)}Ff(b,Iy(b,f)),is(b)}),{id:f}}function qI(e){if(!Array.isArray(e))return;let t=e.some(Array.isArray)?e.filter(Array.isArray):[e],n=[],s=new Set;for(let o of t){let r=o.filter(a=>typeof a=="string"&&a);if(!r.length)continue;let i=[...r].sort().join(" ");s.has(i)||(s.add(i),n.push(r))}return n.length?n:void 0}async function as(e,t){let n=[],s=0;for(let r of t||[]){let i=q(r?.subject),a=Zn(r?.predicate),c=q(r?.object);if(!i||!a||!c){s+=1;continue}let l=`${i} ${a} ${c}`;n.push({id:Co(i,a,c),s:i,p:a,o:c,text:l,tokens:xa({doc:l}),provenance:As(r?.provenance),createdAt:r?.createdAt||"",observedAt:r?.observedAt||"",quantifier:As(r?.quantifier),premiseTrusts:Array.isArray(r?.premiseTrusts)?r.premiseTrusts:void 0,ruleConfidence:typeof r?.ruleConfidence=="number"?r.ruleConfidence:void 0,environments:qI(r?.justification)})}let o=[];return n.length?(await Ps(e,r=>{let i=[],a=new Set,c=new Map;for(let u of n){let d=_y(r,u.id,u.provenance,u.createdAt);for(let p of d.length?[]:Ty(r,u.id,{quantifier:u.quantifier,environments:u.environments}))a.has(p)||(a.add(p),i.push(p)),(u.premiseTrusts!==void 0||u.ruleConfidence!==void 0)&&c.set(p,{premiseTrusts:u.premiseTrusts,ruleConfidence:u.ruleConfidence});for(let p of d){let f=Ay(r,{groupId:u.id,s:u.s,p:u.p,o:u.o,label:Lc(u.text),tokens:u.tokens,group:p,createdAt:u.createdAt,observedAt:u.observedAt,quantifier:u.quantifier,environments:u.environments});for(let m of Cy(r,f))a.has(m)||(a.add(m),i.push(m));(u.premiseTrusts!==void 0||u.ruleConfidence!==void 0)&&c.set(f.candidate.id,{premiseTrusts:u.premiseTrusts,ruleConfidence:u.ruleConfidence})}o.push(u.id)}for(let u of i)Cr(r,oo(r,u),void 0,c.get(u));let l=[];for(let u of new Set(o))l.push(...Iy(r,u));Ff(r,l),is(r)}),{ids:o,appended:o.length,skipped:s}):{ids:o,appended:0,skipped:s}}async function Dc(e,{name:t,kind:n,slots:s,provenance:o="",createdAt:r=""}={}){let i=Ny[n];if(!i)throw new Error(`a rule kind must be one of ${KI.join(", ")}, got ${JSON.stringify(n)}`);let a=q(t);if(!a)throw new Error("a rule needs a name");let c=YI[n]||new Set,l=i.map(([f])=>q(s?.[f])),u=i.filter(([f],m)=>!c.has(f)&&!l[m]);if(u.length)throw new Error(`a ${n} rule needs ${u.map(([f])=>f).join(" + ")}`);if(n===Bi){let f=l[i.findIndex(([h])=>h==="objectRole")],m=l[i.findIndex(([h])=>h==="value")];if(!f&&!m)throw new Error(`a ${n} rule needs an objectRole or a value`)}let d=XI(n,a,l),p=Lc(`${a} = ${n}(${l.join(", ")})`);return await Ps(e,async f=>{let m=f.individuals.find($=>$?.id===d),h=m?.attributes?.find($=>$?.prop==="mgx:factProvenance")?.value||"",g=[...new Set([...h.split(" | "),As(o)].filter(Boolean))],b=Lf(m,r),y={id:d,label:p,class:Nr,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:Fc,key:"ruleName",value:a},{prop:Pr,key:"ruleKind",value:n},...i.map(([$,E],_)=>({prop:E,key:$,value:l[_],skip:!l[_]&&c.has($)})).filter($=>!$.skip).map(({skip:$,...E})=>E),{prop:lt,key:"createdAt",value:b},...g.length?[{prop:"mgx:factProvenance",key:"provenance",value:g.join(" | ")}]:[]]};await uf(y),Ls(f,y),Cr(f,f.individuals.find($=>$?.id===d)),is(f)}),{id:d}}function Bf(e,t){let n=q(t);return(e?.individuals||[]).find(s=>s?.class===Nr&&(s.attributes||[]).find(o=>o?.prop===Fc)?.value===n)}function JI(e,t){let n=q(t),s=o=>(o.attributes||[]).find(r=>r?.prop===Pr)?.value||"";return(e?.individuals||[]).filter(o=>o?.class===Nr&&(o.attributes||[]).find(r=>r?.prop===Fc)?.value===n).sort((o,r)=>s(o).localeCompare(s(r))||String(o.id).localeCompare(String(r.id)))}function zc(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==Nr)continue;let s=a=>(n.attributes||[]).find(c=>c?.prop===a)?.value,o=s(Pr),r=Ny[o];if(!r)continue;let i={};for(let[a,c]of r)i[a]=s(c)??"";t.push({id:n.id,name:s(Fc)||"",kind:o,slots:i,provenance:s("mgx:factProvenance")||""})}return t.sort((n,s)=>n.name.localeCompare(s.name)||n.kind.localeCompare(s.kind)||String(n.id).localeCompare(String(s.id))),t}async function Wf(e,t,n,s,o){let{relationFactsFor:r,renderFactLine:i,factPhrase:a,factTermVariants:c,byTrust:l,rows:u,HAS_PROPERTY_PREDICATE:d,findActionPath:p}=o,f=String(t||"").trim().toLowerCase(),m=c(q,n),h=c(q,s),g=r(f).filter($=>m.has($.fact.subject)&&h.has($.fact.object));if(g.length){let $=g.slice().sort((E,_)=>l(E.fact,_.fact))[0];return{citation:[i($.fact),...$.aliasFacts.map(E=>`${a(E)}${E.provenance?` (source: ${E.provenance})`:""}`)]}}let b=Bf(e,f),y=b?.attributes?.find($=>$.prop===Pr)?.value;if(b&&y===zi){let $=b.attributes.find(I=>I.prop==="mgx:ruleBase1")?.value,E=b.attributes.find(I=>I.prop==="mgx:ruleBase2")?.value,_=q(n),v=q(s);if(!$||!E||!_||!v)return null;let R=p({entity:_,hopsTaken:0},I=>I.hopsTaken===2&&I.entity===v,I=>{if(I.hopsTaken>=2)return[];let j=I.hopsTaken===0?$:E;return r(j).filter(k=>k.fact.subject===I.entity).map(k=>({action:k,nextState:{entity:k.fact.object,hopsTaken:I.hopsTaken+1}}))},{maxDepth:2,stateKey:I=>`${I.entity}#${I.hopsTaken}`});if(!R)return null;let w=new Set,T=[];for(let I of R.actions){T.push(i(I.fact));for(let j of I.aliasFacts){let k=j.id||`${j.subject}|${j.predicate}|${j.object}`;w.has(k)||(w.add(k),T.push(`${a(j)}${j.provenance?` (source: ${j.provenance})`:""}`))}}return{citation:T}}if(b&&y===Ui){let $=b.attributes.find(x=>x.prop==="mgx:ruleBase1")?.value,E=b.attributes.find(x=>x.prop==="mgx:ruleFilterProperty")?.value;if(!$||!E)return null;let _=await Wf(e,$,n,s,o);if(!_)return null;let v=q(n),S=q(E),C=u.find(x=>x.predicate===d&&x.subject===v&&q(x.object)===S);return C?{citation:[..._.citation,i(C)]}:null}return null}async function Ly(e,t,n,s){let{relationFactsFor:o,renderFactLine:r,factPhrase:i,factTermVariants:a,byTrust:c,rows:l,HAS_PROPERTY_PREDICATE:u,findReachableSet:d}=s,p=String(t||"").trim().toLowerCase(),f=a(q,n),m=o(p).filter(b=>f.has(b.fact.object));if(m.length){let b=new Map;for(let y of m)b.has(y.fact.subject)||b.set(y.fact.subject,[]),b.get(y.fact.subject).push(y);return[...b.entries()].map(([y,$])=>{let E=$.slice().sort((_,v)=>c(_.fact,v.fact))[0];return{subject:y,citation:[r(E.fact),...E.aliasFacts.map(_=>`${i(_)}${_.provenance?` (source: ${_.provenance})`:""}`)]}})}let h=Bf(e,p),g=h?.attributes?.find(b=>b.prop===Pr)?.value;if(h&&g===zi){let b=h.attributes.find(S=>S.prop==="mgx:ruleBase1")?.value,y=h.attributes.find(S=>S.prop==="mgx:ruleBase2")?.value,$=q(n);return!b||!y||!$?[]:d({entity:$,hopsTaken:0},S=>{if(S.hopsTaken>=2)return[];let C=S.hopsTaken===0?y:b;return o(C).filter(x=>x.fact.object===S.entity).map(x=>({action:x,nextState:{entity:x.fact.subject,hopsTaken:S.hopsTaken+1}}))},{maxDepth:2,stateKey:S=>`${S.entity}#${S.hopsTaken}`}).filter(S=>S.node.hopsTaken===2).map(({node:S,path:C})=>{let x=new Set,R=[];for(let w of C.actions.slice().reverse()){R.push(r(w.fact));for(let T of w.aliasFacts){let I=T.id||`${T.subject}|${T.predicate}|${T.object}`;x.has(I)||(x.add(I),R.push(`${i(T)}${T.provenance?` (source: ${T.provenance})`:""}`))}}return{subject:S.entity,citation:R}})}if(h&&g===Ui){let b=h.attributes.find(v=>v.prop==="mgx:ruleBase1")?.value,y=h.attributes.find(v=>v.prop==="mgx:ruleFilterProperty")?.value;if(!b||!y)return[];let $=await Ly(e,b,n,s),E=q(y),_=[];for(let v of $){let S=q(v.subject),C=l.find(x=>x.predicate===u&&x.subject===S&&q(x.object)===E);C&&_.push({subject:v.subject,citation:[...v.citation,r(C)]})}return _}return[]}function bt(e,t={}){let n=Gf(e),s=my(e),o=[];for(let[r,i]of n.groups){let a=Vf(r,i,n),c=s?.get(r);a.trust=ja(c?c.inputs:a.assertions,t).score,o.push(a)}return o}function Gf(e){let t=e?.individuals||[],n=new Map(t.filter(c=>c?.class===Or).map(c=>[c.id,c])),s=(e?.objectProperties||[]).find(c=>c?.prop===_n),o=new Map;for(let c of s?.examples||[])o.has(c.subject)||o.set(c.subject,[]),o.get(c.subject).push(c.object);let r=new Map,i=new Map;for(let c of t){if(c?.class===bn){let d=Yt(c.id),p=i.get(d);p?p.push(c):i.set(d,[c]);continue}if(c?.class!==Et||(c.attributes||[]).some(d=>d?.prop===Di)||Tr(c.id))continue;let l=Yt(c.id),u=r.get(l);u?u.push(c):r.set(l,[c])}for(let[c,l]of i){let u=r.get(c);if(!u)continue;let d=u.filter(p=>!wc(l,p.id,Lr(os(p,"mgx:factProvenance").split(" | ").filter(Boolean),os(p,lt))));d.length!==u.length&&(d.length?r.set(c,d):r.delete(c))}let a=new Map;for(let[c,l]of r){l.sort((p,f)=>p.id<f.id?-1:p.id>f.id?1:0);let u=$f(Pi(l[0],"subject"),Pi(l[0],"predicate")),d=a.get(u);d?d.push(c):a.set(u,[c])}return{groups:r,groupsByPair:a,statedByRecord:o,sourceTypeOf:c=>(n.get(c)?.attributes||[]).find(l=>l?.prop==="mgx:sourceType")?.value||""}}function Vf(e,t,n){let{statedByRecord:s,sourceTypeOf:o}=n,r=os,i=Pi,a=[],c=[],l=[],u=new Set,d=[],p=new Set,f="";for(let g of t){if(so(g.id)){let S=Ri(g.id),C=pc(g);for(let x of C)c.includes(x)||(c.push(x),S&&l.push(S));a.push({id:g.id,sourceId:"",sourceType:S,provenance:"",createdAt:r(g,ts),ownTrust:Number(r(g,_r))||0,assertedAt:r(g,ns),rollup:{count:Number(r(g,ki))||C.length,sourceIds:C,earliest:r(g,ts),latest:r(g,ns)}});continue}let b=r(g,"mgx:factProvenance").split(" | ").filter(Boolean);for(let S of b)u.add(S);let[y]=s.get(g.id)||[],$=y||r(g,Fo),E=o($);y&&!c.includes(y)&&(c.push(y),E&&l.push(E));let _=r(g,lt),v=r(g,Li);a.push({id:g.id,sourceId:$,sourceType:E,provenance:b.join(" | "),createdAt:_,...v?{observedAt:v}:{},ownTrust:Number(r(g,cr))||0,assertedAt:Lr(b,_)}),f=f||i(g,"quantifier");for(let S of i(g,"justification").split(" | ")){let C=S.split(" ").filter(Boolean);if(!C.length)continue;let x=C.join(" ");p.has(x)||(p.add(x),d.push(C))}}let m=[],h=new Set;for(let g of d)for(let b of g)h.has(b)||(h.add(b),m.push(b));return{id:e,subject:i(t[0],"subject"),predicate:i(t[0],"predicate"),object:i(t[0],"object"),provenance:[...u].sort().join(" | "),quantifier:f,sourceIds:c,sourceTypes:l,environments:d,justification:m,assertions:a}}function QI(e){let t=os(e,Fo);if(t)return t;let n=String(e?.id||""),s=n.indexOf("@");if(s<0)return"";let o=n.slice(s+1),r=o.indexOf("#");return r<0?o:o.slice(0,r)}async function Py(e,t,{provenance:n="",retractedAt:s=""}={}){let o=new Set((t||[]).filter(Boolean)),r=[],i=[];if(!o.size)return{removed:r,records:i};let a=s||Ns();return await Ps(e,c=>{let l=new Set,u=new Set,d=new Map;c.individuals=(c.individuals||[]).filter(p=>{if(p?.class!==Et)return!0;let f=Yt(p.id),m=o.has(p.id)?p.id:o.has(f)?f:"";if(!m)return!0;u.add(m),l.add(p.id);let h=QI(p),g=`${f}\0${h}`,b=os(p,"mgx:factProvenance"),y=d.get(g);return y?(y.ids.push(p.id),b&&y.tags.push(b)):d.set(g,{groupId:f,sourceId:h,ids:[p.id],tags:b?[b]:[],template:{label:p.label||"",subject:os(p,"rdf:subject"),predicate:os(p,"rdf:predicate"),object:os(p,"rdf:object")}}),!1});for(let p of u)r.push(p);if(r.length){for(let p of l)i.push(p);for(let p of c.objectProperties||[]){let f=p.examples||[];p.examples=f.filter(m=>!l.has(m?.subject)&&!l.has(m?.object)),p.count=p.examples.length}for(let p of d.values()){let f=Pw({groupId:p.groupId,sourceId:p.sourceId,recordIds:p.ids,retractedAt:a,template:p.template,provenance:[...p.tags,n].filter(Boolean).join(" | ")});f&&Ls(c,f)}is(c)}}),{removed:r,records:i}}function ZI(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==bn)continue;let s=yc(n);s&&t.push(s)}return t.sort((n,s)=>n.id<s.id?-1:n.id>s.id?1:0)}async function eO(e,t){let n=[];for(let o of t||[]){let r=$c(o);r&&n.push(r)}let s=[];return n.length?(await Ps(e,o=>{let r=new Map;for(let a of n){let c=Ls(o,a),l=Yt(c.id),u=r.get(l);u?u.push(c):r.set(l,[c])}let i=new Set;for(let[a,c]of r)for(let l of Do(o,a)){let u=oo(o,l);if(!u)continue;let d=os(u,"mgx:factProvenance").split(" | ").filter(Boolean);wc(c,l,Lr(d,os(u,lt)))&&i.add(l)}if(i.size){Ff(o,i);for(let a of i)s.push(a)}is(o)}),{merged:n.length,removed:s}):{merged:0,removed:s}}function tO(e,{self:t="",acknowledgedBy:n=null}={}){let s=vc(bt(e)),o=[];for(let r of e?.individuals||[])r?.class===bn&&r.id&&o.push(r.id);return{roster:s,retirable:xc({recordIds:o,roster:s,self:t,acknowledgedBy:n})}}async function nO(e,t){let n=new Set((t||[]).filter(Boolean)),s=[];return n.size?(await Ps(e,o=>{let r=new Set;if(o.individuals=(o.individuals||[]).filter(a=>a?.class!==bn||!n.has(a.id)?!0:(r.add(a.id),!1)),!r.size)return;for(let a of r)s.push(a);let i=Xt(o);if(i)for(let a of r){i.individualsById.delete(a);let c=Yt(a),l=(i.retractionsByGroup.get(c)||[]).filter(u=>!r.has(u.id));l.length?i.retractionsByGroup.set(c,l):i.retractionsByGroup.delete(c)}is(o)}),{retired:s}):{retired:s}}function My(e,{floor:t=sO}={}){let n=bt(e).filter(r=>r.trust>=t),s=new Map;for(let r of n){if(lc(r.predicate)===Wd)continue;let i=`${r.subject} ${r.predicate}`;s.has(i)||s.set(i,[]),s.get(i).push(r)}let o=[];for(let r of s.values()){if(new Set(r.map(a=>a.object)).size<2)continue;let i=lc(r[0].predicate);i!==Gd&&!Hd(r,i).contested||o.push(r.slice().sort((a,c)=>c.trust-a.trust||a.object.localeCompare(c.object)))}return o.sort((r,i)=>`${r[0].subject} ${r[0].predicate}`.localeCompare(`${i[0].subject} ${i[0].predicate}`))}var Ir,Sf,jf,Et,kf,Or,Nr,Rf,_f,JC,_n,Tf,ny,Cc,bf,sy,QC,Zw,ZC,wf,Af,oy,eI,Os,Li,Fo,Ic,Di,dy,os,Pi,$f,fy,my,rI,uI,ey,Bn,$y,vf,xI,gf,SI,Of,vy,Nf,xy,xf,Xt,Lc,Ns,Mf,FI,zi,Ui,Df,zf,Mc,Bi,Uf,KI,Fc,Pr,Ny,YI,XI,sO,Mr,oO,rO,qe=M(()=>{Lt();Je();qs();it();it();Mn();vw();Mn();cc();Zd();rf();lf();Uw();Zd();rf();lf();Ir=ne(".tmct","memory"),Sf=ne(Ir,"graph.json"),jf="Utterance",Et="Fact",kf="Session",Or="Source",Nr="Rule",Rf="mgx:saidInSession",_f="mgx:inReplyTo",JC="mgx:derivedFrom",_n="mgx:statedBy",Tf="mgx:canonicalisedFrom",ny="mgx:sourceReliability",Cc="src:operator-chat",bf="src:teach-chat",sy="src:teach-node",QC=new Set(["visitor","tmct"]),Zw=48,ZC=[{prop:"rdf:type",note:"rdf-ish typing attribute: owl:NamedIndividual (utterances/sessions) or rdf:Statement (reified facts)"},{prop:"mgx:utteranceRole",note:"who said it: visitor (an a-visitor-said item) or tmct (the response alongside it)"},{prop:"mgx:utteranceText",note:"the utterance's normalized text (capped)"},{prop:"mgx:utteranceTs",note:"when it was said, ISO-8601 (the chat turn timestamp)"},{prop:"mgx:utteranceParsed",note:"optional JSON of the parse the interpretation pipeline produced for this request"},{prop:Rf,predicate:"saidInSession",note:"Utterance \u2192 Session it was said in; runtime observation, owned (no SEON term)"},{prop:_f,predicate:"inReplyTo",note:"tmct Utterance \u2192 the visitor Utterance it answers (the Q/A pairing)"},{prop:"rdf:subject",note:"reified fact: the triple's subject term"},{prop:"rdf:predicate",note:"reified fact: the triple's predicate term"},{prop:"rdf:object",note:"reified fact: the triple's object term"},{prop:"mgx:factProvenance",note:"LEGACY COMPAT SHIM: the ' | '-joined provenance tag string a fact came from; the source-of-truth is now the mgx:statedBy edges derived from it"},{prop:"mgx:sourceId",note:"the assertion key a Fact record is filed under \u2014 the Source id of the ONE party asserting it, which is also the @-suffix of the record's own id. `src:none` when no tag names a Source, so every record has a key rather than a hole"},{prop:"mgx:observedAt",note:"OPTIONAL valid time: when the asserting party WITNESSED the claim, as against mgx:createdAt's transaction time (when this store recorded it). A stale article read today loses to an eyewitness report from yesterday. Stored only when a caller supplies one \u2014 never fabricated, never backfilled"},{prop:"mgx:supersedes",note:"the record id(s) this one replaced when its own source re-asserted the triple with a newer embedded timestamp. A space-joined LIST; absent, never empty, until the first supersession"},{prop:"mgx:supersededBy",note:"the record id(s) that replaced this one. Its presence is what makes a record a demoted leaf rather than a live head, and the group fold skips it: a source's past belief is not a second vote for the present one. A LIST, because one source with two live replicas can fork before they sync"},{prop:"mgx:factQuantifier",note:"OPTIONAL: the quantifier word a plural class-membership teach used ('every'/'some'/'a few'), for literal recall by 'how many Xs are Ys' \u2014 never real cardinality counting"},{prop:"mgx:factJustification",note:"an entailed Fact's supporting premise fact ids: ' | '-separated environments, one space-separated premise-id list per independent derivation, capped by syllogise's maxEnvironments knob; a value with no ' | ' is a single environment"},{prop:"mgx:ruleName",note:"a taught Rule's own name (e.g. 'grandparent') \u2014 the query-dispatcher's lookup key, PLAN_TAUGHT_RELATIONS.md \xA72/\xA73"},{prop:"mgx:ruleKind",note:"a taught Rule's SHAPE tag \u2014 the closed vocabulary compose2 | filter | recursive (structural, like 'Fact'/'Rule' themselves, never a domain word)"},{prop:"mgx:ruleBase1",note:"compose2: the first hop's base relation name; filter: the base rule/relation being filtered (same 'base relation' role in both kinds, so the name is shared)"},{prop:"mgx:ruleBase2",note:"compose2 only: the second hop's base relation name"},{prop:"mgx:ruleFilterProperty",note:"filter only: the property literal candidates are filtered by (an mgx:hasProperty-shaped Fact lookup)"},{prop:"mgx:ruleBaseCase",note:"recursive only: the base-case relation name (hop zero)"},{prop:"mgx:ruleRecStep",note:"recursive only: the self-referential recursive-step relation name"},{prop:lt,note:"when an individual was FIRST written, ISO-8601 (first-write-wins on upsert); the audit 'when', the recency input to trust, the novelty signal"},{prop:Ks,note:"an audit / last-modified stamp: when an individual's OWN attributes were last mutated in place (upsertSession, recomputeFactTrust, recomputeSourceReliability) \u2014 most individuals never carry it at all. NOT transaction time: a mutable stamp cannot record when the previous version stopped being current, so tmct is not bitemporal"},{prop:JC,predicate:"derivedFrom",note:"umbrella: a Fact derived from a Source (or another Fact). ext ref prov:wasDerivedFrom (UNVERIFIED-pending-web-check)"},{prop:_n,predicate:"statedBy",note:"subPropertyOf derivedFrom: a Source directly asserts this Fact (one edge per independent source \u2014 replaces the factProvenance union)"},{prop:Tf,predicate:"canonicalisedFrom",note:"subPropertyOf derivedFrom: a canonical Fact cleaned from a raw Block/Source, never replacing it"},{prop:"mgx:sourceType",note:"a Source's kind: operator | teach | provider | corpus | corpusWeak | reference | referenceLive | extracted | optimisticExtract | web | entailed (the trust-prior key)"},{prop:"mgx:sourceUrl",note:"a web Source's URL"},{prop:"mgx:sourceRule",note:"an entailed Source's rule id"},{prop:"mgx:sourceReliability",note:"actor-level (session-scoped) trust nudge in [0.5,1.5], neutral 1.0 when absent \u2014 materialised by recomputeSourceReliability from a session's asserted-vs-contradicted track record (memory/trust.mjs's sessionReliabilityFrom); folds into computeTrust's per-source prior"},{prop:cr,note:"materialised trust cache in [0,1] \u2014 pure function of a fact's Sources + createdAt (memory/trust.mjs); invalidated when a statedBy edge is added"},{prop:Ea,note:"JSON of the inputs the trust score was computed from (source-type multiset, corroboration count, createdAt, recency) \u2014 makes the score auditable"},{prop:"mgx:hasProseTokens",note:"prose tokens (prose.mjs tokenizer) backing the payload's proseIndex"},{prop:"mgx:sessionStarted",note:"session anchor: when the session started, ISO-8601"},{prop:"rdf:predicate",prefix:Er,note:"a reified fact's predicate carries its POLARITY: mgxneg:capableOf is the negative twin of mgx:capableOf ('a penguin cannot fly'). Polarity cannot be a separate property \u2014 the fact id hashes (subject, predicate, object), so both polarities would share one id and union their statedBy edges (memory/capability.mjs)"}];wf=e=>Ni(e),Af="memory",oy="sqlite";eI=`
101
+ `))return r}}throw new $e("cannot find end of structure",{toml:e,ptr:t})}var Rc=M(()=>{Mo();});function oI(e,t,n){let s=e.slice(t,n),o=s.indexOf("#");return o>-1&&(Ar(e,o),s=s.slice(0,o)),[s.trimEnd(),o]}function Li(e,t,n,s,o){if(s===0)throw new $e("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let r=e[t];if(r==="["||r==="{"){let[c,l]=r==="["?Jw(e,t,s,o):Xw(e,t,s,o);if(n){if(l=ss(e,l),e[l]===",")l++;else if(e[l]!==n)throw new $e("expected comma or end of structure",{toml:e,ptr:l})}return[c,l]}if(r==='"'||r==="'"){let[c,l]=jc(e,t);if(n){if(l=ss(e,l),e[l]&&e[l]!==","&&e[l]!==n&&e[l]!==`
102
+ `&&e[l]!=="\r")throw new $e("unexpected character encountered",{toml:e,ptr:l});e[l]===","&&l++}return[c,l]}let i=Yw(e,t,",",n),a=oI(e,t,i-(e[i-1]===","?1:0));if(!a[0])throw new $e("incomplete key-value declaration: no value specified",{toml:e,ptr:t});return n&&a[1]>-1&&(i=ss(e,t+a[1]),e[i]===","&&i++),[Kw(a[0],e,t,o),i]}var gf=M(()=>{hf();bf();Rc();Mo();});function _c(e,t,n="="){let s=t-1,o=[],r=e.indexOf(n,t);if(r<0)throw new $e("incomplete key-value: cannot find end of key",{toml:e,ptr:t});do{let i=e[t=++s];if(i!==" "&&i!==" ")if(i==='"'||i==="'"){if(i===e[t+1]&&i===e[t+2])throw new $e("multiline strings are not allowed in keys",{toml:e,ptr:t});let[a,c]=jc(e,t);s=e.indexOf(".",c);let l=e.slice(c,s<0||s>r?r:s),u=kc(l);if(u>-1)throw new $e("newlines are not allowed in keys",{toml:e,ptr:t+s+u});if(l.trimStart())throw new $e("found extra tokens after the string part",{toml:e,ptr:c});if(r<c&&(r=e.indexOf(n,c),r<0))throw new $e("incomplete key-value: cannot find end of key",{toml:e,ptr:t});o.push(a)}else{s=e.indexOf(".",t);let a=e.slice(t,s<0||s>r?r:s);if(!rI.test(a))throw new $e("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:t});o.push(a.trimEnd())}}while(s+1&&s<r);return[o,ss(e,r+1,!0,!0)]}function Xw(e,t,n,s){let o={},r=new Set,i;for(t++;(i=e[t++])!=="}"&&i;){if(i===",")throw new $e("expected value, found comma",{toml:e,ptr:t-1});if(i==="#")t=Ar(e,t);else if(i!==" "&&i!==" "&&i!==`
103
+ `&&i!=="\r"){let a,c=o,l=!1,[u,d]=_c(e,t-1);for(let m=0;m<u.length;m++){if(m&&(c=l?c[a]:c[a]={}),a=u[m],(l=Object.hasOwn(c,a))&&(typeof c[a]!="object"||r.has(c[a])))throw new $e("trying to redefine an already defined value",{toml:e,ptr:t});!l&&a==="__proto__"&&Object.defineProperty(c,a,{enumerable:!0,configurable:!0,writable:!0})}if(l)throw new $e("trying to redefine an already defined value",{toml:e,ptr:t});let[p,f]=Li(e,d,"}",n-1,s);r.add(p),c[a]=p,t=f}}if(!i)throw new $e("unfinished table encountered",{toml:e,ptr:t});return[o,t]}function Jw(e,t,n,s){let o=[],r;for(t++;(r=e[t++])!=="]"&&r;){if(r===",")throw new $e("expected value, found comma",{toml:e,ptr:t-1});if(r==="#")t=Ar(e,t);else if(r!==" "&&r!==" "&&r!==`
104
+ `&&r!=="\r"){let i=Li(e,t-1,"]",n-1,s);o.push(i[0]),t=i[1]}}if(!r)throw new $e("unfinished array encountered",{toml:e,ptr:t});return[o,t]}var rI,bf=M(()=>{hf();gf();Rc();Mo();rI=/^[a-zA-Z0-9-_]+[ \t]*$/});function Qw(e,t,n,s){let o=t,r=n,i,a=!1,c;for(let l=0;l<e.length;l++){if(l){if(o=a?o[i]:o[i]={},r=(c=r[i]).c,s===0&&(c.t===1||c.t===2))return null;if(c.t===2){let u=o.length-1;o=o[u],r=r[u].c}}if(i=e[l],(a=Object.hasOwn(o,i))&&r[i]?.t===0&&r[i]?.d)return null;a||(i==="__proto__"&&(Object.defineProperty(o,i,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(r,i,{enumerable:!0,configurable:!0,writable:!0})),r[i]={t:l<e.length-1&&s===2?3:s,d:!1,i:0,c:{}})}if(c=r[i],c.t!==s&&!(s===1&&c.t===3)||(s===2&&(c.d||(c.d=!0,o[i]=[]),o[i].push(o={}),c.c[c.i++]=c={t:1,d:!1,i:0,c:{}}),c.d))return null;if(c.d=!0,s===1)o=a?o[i]:o[i]={};else if(s===0&&a)return null;return[i,o,c.c]}function Fo(e,{maxDepth:t=1e3,integersAsBigInt:n}={}){let s={},o={},r=s,i=o;for(let a=ss(e,0);a<e.length;){if(e[a]==="["){let c=e[++a]==="[",l=_c(e,a+=+c,"]");if(c){if(e[l[1]-1]!=="]")throw new $e("expected end of table declaration",{toml:e,ptr:l[1]-1});l[1]++}let u=Qw(l[0],s,o,c?2:1);if(!u)throw new $e("trying to redefine an already defined table or value",{toml:e,ptr:a});i=u[2],r=u[1],a=l[1]}else{let c=_c(e,a),l=Qw(c[0],r,i,0);if(!l)throw new $e("trying to redefine an already defined table or value",{toml:e,ptr:a});let u=Li(e,c[1],void 0,t,n);l[1][l[0]]=u[0],a=u[1]}if(a=ss(e,a,!0),e[a]&&e[a]!==`
105
+ `&&e[a]!=="\r")throw new $e("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:a});a=ss(e,a)}return s}var Zw=M(()=>{bf();gf();Rc();Mo();});var ey=M(()=>{});var Tc=M(()=>{Zw();ey();mf();Mo();});var wf={};Lt(wf,{CONFIG_FILE:()=>Cc,loadTomlConfig:()=>Ic,mergeEffective:()=>ny,normalizeConfig:()=>ty});async function Ic(e,{file:t}={}){let n=t||ne(e,Cc),s;try{s=await Ie(n,"utf8")}catch(o){if(o&&o.code==="ENOENT")return null;throw o}try{return Fo(s)}catch(o){throw new Error(`Invalid ${Cc} at ${n}: ${o&&o.message?o.message:o}`)}}async function iI(e,t){let n;if(Array.isArray(e))n=e;else{let o=Gt(t,String(e));n=(await Ie(o,"utf8")).split(`
106
+ `)}let s=[];for(let o of n){let r=String(o).trim();!r||r.startsWith("#")||s.push(Gt(t,r))}return s}async function ty(e,{configDir:t}={}){let n=e||{},s=t||process.cwd(),o={};if(n.repositories!==void 0&&(o.repositories=await iI(n.repositories,s)),n.out_root!==void 0&&(o.outRoot=Gt(s,String(n.out_root))),n.graph_file!==void 0&&(o.graphFile=Gt(s,String(n.graph_file))),n.graph_files!==void 0){let $=Array.isArray(n.graph_files)?n.graph_files:[n.graph_files];o.graphFiles=$.map(E=>Gt(s,String(E)))}let r=n.graph||{};r.read_only!==void 0&&(o.graph={readOnly:r.read_only});let i=n.corpus||{};i.tier!==void 0&&(o.corpus={tier:i.tier});let a=n.seed||{},c={};a.enabled!==void 0&&(c.enabled=a.enabled),a.limit!==void 0&&(c.limit=a.limit),a.capture_unknown_context!==void 0&&(c.captureUnknownContext=a.capture_unknown_context),a.unknown_context_limit!==void 0&&(c.unknownContextLimit=a.unknown_context_limit),Object.keys(c).length&&(o.seed=c),n.extensions!==void 0&&(o.extensions=n.extensions),n.bias!==void 0&&(o.bias=n.bias),n.games!==void 0&&(o.games=n.games),n.planning!==void 0&&(o.planning=n.planning),n.research!==void 0&&(o.research=n.research),n.news!==void 0&&(o.news=n.news),n.discourse!==void 0&&(o.discourse=n.discourse),n.recognition!==void 0&&(o.recognition=n.recognition),n.reasoning!==void 0&&(o.reasoning=n.reasoning);let l=n.index||{},u={};l.languages!==void 0&&(u.languages=l.languages),l.exclude!==void 0&&(u.exclude=l.exclude),l.secret_exclude!==void 0&&(u.secretExclude=l.secret_exclude),l.history_depth!==void 0&&(u.historyDepth=l.history_depth),l.include_text!==void 0&&(u.includeText=l.include_text),l.include_structure!==void 0&&(u.includeStructure=l.include_structure),l.respect_gitignore!==void 0&&(u.respectGitignore=l.respect_gitignore),l.markdown_sections!==void 0&&(u.markdownSections=l.markdown_sections),l.vue!==void 0&&(u.vue=l.vue),Object.keys(u).length&&(o.index=u);let d=n.tune||{},p={};d.score_gap_k!==void 0&&(p.scoreGapK=d.score_gap_k),d.literal_mention!==void 0&&(p.literalMention=d.literal_mention),d.demote_non_prod!==void 0&&(p.demoteNonProd=d.demote_non_prod),d.call_adjacency!==void 0&&(p.callAdjacency=d.call_adjacency),d.impl_of_interface!==void 0&&(p.implOfInterface=d.impl_of_interface),d.beam_search!==void 0&&(p.beamSearch=d.beam_search),d.beam_width!==void 0&&(p.beamWidth=d.beam_width),d.prose_layers!==void 0&&(p.proseLayers=d.prose_layers);let f=d.expansion||{},m={};f.strategy!==void 0&&(m.strategy=f.strategy),f.nodes!==void 0&&(m.nodes=f.nodes),f.q!==void 0&&(m.q=f.q),f.depth!==void 0&&(m.depth=f.depth),Object.keys(m).length&&(p.expansion=m),Object.keys(p).length&&(o.tune=p);let h=n.telemetry||{};h.enabled!==void 0&&(o.telemetry={enabled:h.enabled});let g=n.memory||{},b={};g.retention_versions!==void 0&&(b.retentionVersions=g.retention_versions),g.backend!==void 0&&(b.backend=g.backend),Object.keys(b).length&&(o.memory=b);let y=[];for(let[$,E]of aI)n[$]&&n[$][E]!==void 0&&y.push(`${$}.${E}`);return o.unwired=y,o}function Ac(e,t="",n={}){for(let[s,o]of Object.entries(e||{})){if(o==null)continue;let r=t?`${t}.${s}`:s;Array.isArray(o)||typeof o!="object"?n[r]=o:Ac(o,r,n)}return n}function ny({args:e={},toml:t=null,defaults:n={}}={}){let s=Ac(n),o=null;if(t){let{unwired:u,...d}=t;o=d}let r=o?Ac(o):{},i=Ac(e),a=[...new Set([...Object.keys(s),...Object.keys(r),...Object.keys(i)])].sort(),c={},l={};for(let u of a)u in i?(c[u]=i[u],l[u]="arg"):u in r?(c[u]=r[u],l[u]="tmct.toml"):(c[u]=s[u],l[u]="default");return{effective:c,sources:l}}var Cc,aI,Pi=M(()=>{Pt();Je();Tc();Cc="tmct.toml";aI=[["index","include_text"],["index","include_structure"],["index","respect_gitignore"],["index","markdown_sections"],["index","vue"]]});var Ms={};Lt(Ms,{CANONICALISED_FROM_PROP:()=>If,CAPABLE_OF_PREDICATE:()=>hO,CHAIN_KEEP_DEPTH:()=>_w,CHAIN_ROLLUP_THRESHOLD:()=>pc,CREATED_AT_PROP:()=>lt,DEFAULT_RETENTION:()=>Sf,FACT_CLASS:()=>Et,GROUP_ROLLUP_THRESHOLD:()=>kw,HAS_A_PREDICATE:()=>Mr,IN_REPLY_TO_PROP:()=>Cf,MEMORY_DIR_REL:()=>Ir,MEMORY_GRAPH_REL:()=>Rf,MEMORY_MANIFEST_REL:()=>Sy,MEMORY_SESSION_CLASS:()=>Tf,MULTI_VALUED_PREDICATES:()=>gO,NODE_ID_REL:()=>Mf,OPERATOR_SOURCE_ID:()=>Oc,RETRACTED_AT_PROP:()=>wc,RETRACTED_COUNT_PROP:()=>sf,RETRACTED_RECORD_IDS_PROP:()=>bc,RETRACTION_CLASS:()=>yn,RETRACTION_PREDICATE:()=>gc,ROLLUP_COUNT_PROP:()=>Ti,ROLLUP_EARLIEST_PROP:()=>ts,ROLLUP_KEEP_PER_TYPE:()=>Rw,ROLLUP_LATEST_PROP:()=>ns,ROLLUP_PRIOR_PROP:()=>_r,ROLLUP_RECORD_IDS_PROP:()=>_i,ROLLUP_SOURCE_IDS_PROP:()=>Rr,RULE_CLASS:()=>Nr,RULE_KIND_ACTION_CONSTRAINT:()=>Gf,RULE_KIND_ACTION_EFFECT:()=>Vi,RULE_KIND_ACTION_PRECOND:()=>Dc,RULE_KIND_ACTION_SIGNATURE:()=>Wf,RULE_KIND_COMPOSE2:()=>Wi,RULE_KIND_FILTER:()=>Gi,RULE_KIND_PROP:()=>Pr,RULE_KIND_RECURSIVE:()=>Bf,SAID_IN_SESSION_PROP:()=>Af,SOURCE_CLASS:()=>Or,SOURCE_RELIABILITY_PROP:()=>iy,STATED_BY_PROP:()=>An,SYLLOGISE_STATE_REL:()=>Pf,UPDATED_AT_PROP:()=>Ks,UTTERANCE_CLASS:()=>_f,admittedNodes:()=>Ec,appendCanonicalisedFromEdges:()=>eO,appendFact:()=>My,appendFacts:()=>as,appendRetractions:()=>dO,appendRule:()=>Uc,appendUtterance:()=>ZI,appendUtterances:()=>Cy,applySeedPayload:()=>ly,attachFactHeads:()=>by,chainRollupIdFor:()=>Jd,cloneMemoryPayload:()=>uy,closeSqliteMemoryStore:()=>vy,createInMemoryStore:()=>Ui,createSqliteMemoryStore:()=>$y,emptyMemory:()=>zi,factGroupId:()=>Xt,factHeadsOf:()=>wy,factIdForTriple:()=>ve,factRecordIdForTag:()=>fI,factRecordIdsFor:()=>zo,findContradictions:()=>Uy,findRuleByName:()=>Vf,findRulesByName:()=>cO,headRollupIdFor:()=>Xd,isChainRollupId:()=>Tr,isHeadRollupId:()=>oo,isMemoryOrSqliteHandle:()=>Nf,isRetractionId:()=>rf,isRollupId:()=>mc,loadMemory:()=>pt,loadNodeId:()=>UI,loadSyllogiseState:()=>DI,normFactPredicate:()=>Zn,normFactTerm:()=>q,openConfiguredMemoryBackend:()=>ao,openExistingMemoryBackend:()=>EI,openMemoryBackend:()=>Lf,peersToConvince:()=>df,provSourceClassFor:()=>GI,provenanceTagToSource:()=>Fn,readFactRows:()=>bt,readObjectSupersessions:()=>$I,readOnlyMemorySnapshot:()=>SI,readRetractions:()=>uO,readRuleRows:()=>Bc,removeFacts:()=>zy,resolveMemoryGraphFile:()=>Mi,resolveRelationChase:()=>Hf,resolveRelationChaseReverse:()=>Dy,retirableRetractions:()=>fO,retireRetractions:()=>pO,retractedAtOf:()=>Po,retractedRecordIds:()=>Lo,retractionFromWire:()=>xc,retractionIdFor:()=>of,retractionScopeOf:()=>af,retractionWireFact:()=>vc,saveNodeId:()=>BI,saveSyllogiseState:()=>zI,snapshotMemory:()=>NI,stableRecordIds:()=>Sc});function zi(){return{generated_at:"",memory:!0,prefixes:{owl:"http://www.w3.org/2002/07/owl#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",mgx:"urn:tmct:mgx#",mgxneg:"urn:tmct:mgxneg#"},vocabulary:uI.map(e=>({...e})),classes:[],objectProperties:[],individuals:[],proseIndex:{}}}function Mi(e,t=null){if(io(e)||rs(e))throw new Error("resolveMemoryGraphFile: dir is a memory/sqlite handle, not a file path (Backend A only)");return t===null?ne(e,Rf):ne(e,Ir,`graph.v${t}.json`)}function io(e){return!!e&&typeof e=="object"&&e.backend===Of}function rs(e){return!!e&&typeof e=="object"&&e.backend===cy}function Nf(e){return io(e)||rs(e)}function Ui(){return{backend:Of,payload:zi()}}function ly(e,t){t&&(e.payload={...e.payload,...t})}function uy(e){if(!e)return null;try{return structuredClone(e)}catch{return JSON.parse(JSON.stringify(e))}}function dy(e){for(let t of String(e||"").split(" | ")){if(!t)continue;let n=Df(Fn(t));if(n)return n}return{id:Os,type:""}}function Xt(e){let t=String(e||""),n=t.indexOf("@");return n<0?t:t.slice(0,n)}function fI(e,t){return`${e}@${fy(t).id}`}function fy(e){return Df(Fn(e))||{id:Os,type:""}}function py(e){let t=new Map;for(let n of String(e||"").split(" | ")){let s=n.trim();if(!s)continue;let{id:o,type:r}=fy(s),i=t.get(o)||{sourceId:o,sourceType:r,tags:[]};i.tags.includes(s)||i.tags.push(s),t.set(o,i)}return t.size||t.set(Os,{sourceId:Os,sourceType:"",tags:[]}),[...t.values()]}function xf(e,t=Math.max){let n="",s=null;for(let o of e||[]){let r=Fn(o)?.createdAt||"",i=Date.parse(r);Number.isFinite(i)&&(s===null||t(i,s)===i)&&(n=r,s=i)}return n}function Lr(e,t="",n=Math.max){return xf(e,n)||(Number.isFinite(Date.parse(t))?String(t):"")}function pI(e,t){let n=Date.parse(e.assertedAt),s=Date.parse(t.assertedAt);return!Number.isFinite(n)||!Number.isFinite(s)?!1:n>s?!0:n===s&&!!e.observedAt&&!t.observedAt}function my(e,t){let n=i=>(e.attributes||[]).find(a=>a?.prop===i)?.value||"",s=dy(n("mgx:factProvenance")),o=n(Bi).split(" ").filter(Boolean)[0]||null,r=Ai(e.id);return[e.id,Xt(e.id),n("rdf:subject"),n("rdf:predicate"),n("rdf:object"),n(Do)||s.id,r||s.type,Number(n(r?_r:lr))||0,n(lt),n(Fi)||null,o,t]}function mI(e){if(e.prepare("SELECT id FROM facts LIMIT 1").get()||!e.prepare("SELECT id FROM individuals WHERE class = ? LIMIT 1").get(Et))return;let t=e.prepare(hy);e.exec("BEGIN IMMEDIATE");try{for(let n of e.prepare("SELECT json FROM individuals WHERE class = ?").all(Et))t.run(...my(JSON.parse(n.json),n.json));e.exec("COMMIT")}catch(n){throw e.exec("ROLLBACK"),n}}function hI(e){return(e||[]).map(t=>({sourceId:t.sourceId||"",sourceType:t.sourceType||"",ownTrust:t.ownTrust,assertedAt:t.assertedAt||""}))}function by(e,t){return e&&t&&(e[gy]=t),e}function bI(e){let t=new Map;for(let n of e.prepare("SELECT triple_hash, trust_base, inputs_json FROM fact_heads").all())t.set(n.triple_hash,{trustBase:n.trust_base,inputs:JSON.parse(n.inputs_json)});return t}function yy(e,t,n,s){let o=e.prepare(gI),r=e.prepare("DELETE FROM fact_heads WHERE triple_hash = ?"),i=Ns();for(let a of n){let c=t.groups.get(a);if(!c?.length){r.run(a),s?.delete(a);continue}let l=hI(Kf(a,c,t).assertions),u=Eh(l).score;o.run(a,u,JSON.stringify(l),i),s?.set(a,{trustBase:u,inputs:l})}}function wI(e){let t=e.db;if(t.prepare("SELECT triple_hash FROM fact_heads LIMIT 1").get()||!t.prepare("SELECT id FROM individuals WHERE class = ? LIMIT 1").get(Et))return;let n=qf(xy(e));t.exec("BEGIN IMMEDIATE");try{yy(t,n,n.groups.keys(),null),t.exec("COMMIT")}catch(s){throw t.exec("ROLLBACK"),s}}function yI(e,t,n){let s=e.prepare("SELECT ord, to_id FROM fact_object_supersessions WHERE subject = ? AND predicate = ? ORDER BY ord DESC LIMIT 1"),o=e.prepare("INSERT INTO fact_object_supersessions(subject, predicate, ord, from_id, to_id, recorded_at) VALUES (?, ?, ?, ?, ?, ?)"),r=Ns();for(let i of n){let[a,c]=i.split("\0");if(dc(c)!==Ri)continue;let l=t.groupsByPair.get(i)||[];if(l.length<2)continue;let u=l.map(f=>{let m=Kf(f,t.groups.get(f),t);return m.trust=_a(m.assertions).score,m});if(new Set(u.map(f=>f.object)).size<2)continue;let d=Yd(u,Ri)?.winner?.id;if(!d)continue;let p=s.get(a,c);p?.to_id!==d&&o.run(a,c,(p?.ord??-1)+1,p?.to_id||"",d,r)}}function $I(e,{subject:t,predicate:n}={}){if(!rs(e))return[];let s=t&&n?" WHERE subject = ? AND predicate = ?":"",o=s?[t,n]:[];return e.db.prepare(`SELECT subject, predicate, ord, from_id, to_id, recorded_at FROM fact_object_supersessions${s} ORDER BY subject, predicate, ord`).all(...o).map(r=>({subject:r.subject,predicate:r.predicate,ord:r.ord,fromId:r.from_id,toId:r.to_id,recordedAt:r.recorded_at}))}function xI(){if(oy)return;oy=!0;let e=process.listeners("warning").slice();process.removeAllListeners("warning"),process.on("warning",t=>{if(!(t?.name==="ExperimentalWarning"&&/sqlite/i.test(String(t?.message))))if(e.length)for(let n of e)n(t);else console.error(t.stack||String(t))})}async function $y(e){xI();let{DatabaseSync:t}=await Promise.resolve().then(()=>(qw(),Hw)),n=new t(e);n.exec("PRAGMA journal_mode = WAL"),n.exec("PRAGMA synchronous = NORMAL"),n.exec(dI),mI(n);let s={backend:cy,db:n,dbPath:e};return wI(s),s}function vy(e){rs(e)&&e.db.close()}async function Lf(e,t){if(t===Of)return{dir:Ui(),close:async()=>{}};let n=ne(e,".tmct","memory","graph.sqlite"),s=r=>iu(r).then(()=>!0,()=>!1);!await s(n)&&await s(ne(e,Rf))&&process.stderr.write(`found .tmct/memory/graph.json \u2014 the flat-file memory backend is retired; starting a fresh sqlite store (the old file is left untouched)
107
+ `),await Vn(ye(n),{recursive:!0});let o=await $y(n);return{dir:o,close:async()=>vy(o)}}async function EI(e,t=""){if(!e||typeof e!="string")return null;let n=ne(e,".tmct","memory","graph.sqlite");try{await iu(n)}catch{return null}return Lf(e,t)}async function SI(e){if(!e)return null;let t=Ui();return ly(t,uy(await pt(e))),t}async function ao(e,t=process.env){let n=String(t?.TMCT_MEMORY_BACKEND||"").trim().toLowerCase();if(!n)try{let{loadTomlConfig:s}=await Promise.resolve().then(()=>(Pi(),wf));n=String((await s(e))?.memory?.backend||"").trim().toLowerCase()}catch{n=""}return Lf(e,n)}function jI(e){let t=e.db.prepare("PRAGMA data_version").get()?.data_version;return e.cachedPayload&&e.cachedDataVersion!==t&&(e.cachedPayload=null),e.cachedPayload||(e.cachedPayload=xy(e),e.cachedFactHeads=bI(e.db),e.cachedDataVersion=t),by(Bn(e.cachedPayload),e.cachedFactHeads)}function xy(e){let t=e.db,n=zi(),s=(a,c)=>{let l=t.prepare("SELECT v FROM meta WHERE k = ?").get(a);return l?JSON.parse(l.v):c},o=t.prepare("SELECT json FROM individuals ORDER BY ord").all().map(a=>JSON.parse(a.json)),r=t.prepare("SELECT subject, object, subject_label, object_label, extra FROM edges WHERE prop = ? ORDER BY rowid"),i=t.prepare("SELECT prop, predicate, count FROM relations ORDER BY ord").all().map(a=>({predicate:a.predicate,prop:a.prop,count:a.count,examples:r.all(a.prop).map(c=>{let l={subject:c.subject,object:c.object,subjectLabel:c.subject_label,objectLabel:c.object_label};return c.extra&&Object.assign(l,JSON.parse(c.extra)),l})}));return{generated_at:s("generated_at",n.generated_at),memory:s("memory",n.memory),prefixes:s("prefixes",n.prefixes),vocabulary:s("vocabulary",n.vocabulary),classes:s("classes",n.classes),objectProperties:i,individuals:o,proseIndex:s("proseIndex",n.proseIndex)}}function kI(e,t){let n=Bn(t),s=e.individuals.findIndex(o=>o?.id===t.id);s>=0?e.individuals[s]=n:e.individuals.push(n)}function RI(e,t){e.individuals=e.individuals.filter(n=>t.has(n?.id))}function _I(e,t){let n=e.objectProperties.find(s=>s?.prop===t);return n||(n={predicate:null,prop:t,count:0,examples:[]},e.objectProperties.push(n)),n}function TI(e,t,n){let s=`${t.subject}\0${t.object}`;e.examples=e.examples.filter(r=>`${r.subject}\0${r.object}`!==s);let o={subject:t.subject,object:t.object,subjectLabel:t.subjectLabel??null,objectLabel:t.objectLabel??null};n.length&&Object.assign(o,Bn(Object.fromEntries(n.map(r=>[r,t[r]])))),e.examples.push(o)}function AI(e,t){e.examples=e.examples.filter(n=>t.has(`${n.subject}\0${n.object}`))}function CI(e,t){e.objectProperties=e.objectProperties.filter(n=>t.has(n?.prop))}function II(e,t){let n=e.db,s=zi(),o=e.cachedPayload||null;n.exec("BEGIN IMMEDIATE");try{let r=n.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)");r.run("generated_at",JSON.stringify(t.generated_at??s.generated_at)),r.run("memory",JSON.stringify(t.memory??s.memory)),r.run("prefixes",JSON.stringify(t.prefixes??s.prefixes)),r.run("vocabulary",JSON.stringify(t.vocabulary??s.vocabulary)),r.run("classes",JSON.stringify(t.classes??s.classes)),r.run("proseIndex",JSON.stringify(t.proseIndex??s.proseIndex)),o&&(o.generated_at=Bn(t.generated_at??s.generated_at),o.memory=Bn(t.memory??s.memory),o.prefixes=Bn(t.prefixes??s.prefixes),o.vocabulary=Bn(t.vocabulary??s.vocabulary),o.classes=Bn(t.classes??s.classes),o.proseIndex=Bn(t.proseIndex??s.proseIndex));let i=n.prepare("SELECT ord, json FROM individuals WHERE id = ?"),c=n.prepare("SELECT COALESCE(MAX(ord), -1) AS m FROM individuals").get().m+1,l=n.prepare("INSERT OR REPLACE INTO individuals(id, ord, class, label, json) VALUES (?, ?, ?, ?, ?)"),u=n.prepare(hy),d=new Set,p=new Set,f=new Set;for(let x of t.individuals||[]){d.add(x.id);let R=JSON.stringify(x),w=i.get(x.id);if(w&&w.json===R)continue;let T=w?w.ord:c++;l.run(x.id,T,x.class??null,x.label??null,R),x.class===Et&&(u.run(...my(x,R)),p.add(Xt(x.id)),f.add(Ef(Di(x,"subject"),Di(x,"predicate")))),o&&kI(o,x)}let m=n.prepare("DELETE FROM individuals WHERE id = ?"),h=n.prepare("DELETE FROM facts WHERE id = ?"),g=n.prepare("SELECT triple_hash, subject, predicate FROM facts WHERE id = ?");for(let x of n.prepare("SELECT id FROM individuals").all()){if(d.has(x.id))continue;let R=g.get(x.id);R&&(p.add(R.triple_hash),f.add(Ef(R.subject,R.predicate))),m.run(x.id),h.run(x.id)}o&&RI(o,d);let b=n.prepare("SELECT ord FROM relations WHERE prop = ?"),$=n.prepare("SELECT COALESCE(MAX(ord), -1) AS m FROM relations").get().m+1,E=n.prepare("INSERT OR REPLACE INTO relations(prop, ord, predicate, count) VALUES (?, ?, ?, ?)"),_=n.prepare("SELECT subject, object, subject_label, object_label, extra FROM edges WHERE prop = ?"),v=n.prepare("INSERT OR REPLACE INTO edges(prop, subject, object, subject_label, object_label, extra) VALUES (?, ?, ?, ?, ?, ?)"),S=n.prepare("DELETE FROM edges WHERE prop = ? AND subject = ? AND object = ?"),C=new Set;for(let x of t.objectProperties||[]){C.add(x.prop);let R=_.all(x.prop),w=new Map(R.map(P=>[`${P.subject}\0${P.object}`,P])),T=new Set,I=o?_I(o,x.prop):null;for(let P of x.examples||[]){let U=`${P.subject}\0${P.object}`;T.add(U);let H=Object.keys(P).filter(V=>!vI.has(V)),X=H.length?JSON.stringify(Object.fromEntries(H.map(V=>[V,P[V]]))):null,Q=w.get(U);Q&&(Q.subject_label??null)===(P.subjectLabel??null)&&(Q.object_label??null)===(P.objectLabel??null)&&(Q.extra??null)===(X??null)||(v.run(x.prop,P.subject,P.object,P.subjectLabel??null,P.objectLabel??null,X),I&&TI(I,P,H))}for(let P of w.keys()){if(T.has(P))continue;let[U,H]=P.split("\0");S.run(x.prop,U,H)}I&&AI(I,T);let j=Number.isFinite(x.count)?x.count:(x.examples||[]).length,k=b.get(x.prop)?.ord??$++;E.run(x.prop,k,x.predicate??null,j),I&&(I.predicate=x.predicate??null,I.count=j)}for(let x of n.prepare("SELECT prop FROM relations").all())C.has(x.prop)||(n.prepare("DELETE FROM edges WHERE prop = ?").run(x.prop),n.prepare("DELETE FROM relations WHERE prop = ?").run(x.prop));if(o&&CI(o,C),p.size){let x=qf(t);yy(n,x,p,e.cachedFactHeads),yI(n,x,f)}n.exec("COMMIT")}catch(r){throw n.exec("ROLLBACK"),e.cachedPayload=void 0,e.cachedFactHeads=void 0,r}}async function Ey(e,t){let n=`${e}.tmp-${process.pid}-${Math.random().toString(36).slice(2,10)}`;await tr(n,t),await wa(n,e)}async function Pc(e,t){await Ey(e,JSON.stringify(t))}async function NI(e,{retentionVersions:t}={}){if(Nf(e))throw new Error("snapshotMemory only supports the flat-JSON backend (Backend A) \u2014 a memory/sqlite handle has no on-disk graph.json to snapshot");let n=Mi(e),s;try{s=await Ie(n,"utf8")}catch(u){if(u?.code==="ENOENT")return{skipped:!0,version:null,prunedVersion:null};throw u}let o=OI(e),r;try{r=JSON.parse(await Ie(o,"utf8"))}catch(u){if(u?.code!=="ENOENT")throw u;r={version:0,retentionVersions:t??Sf}}Number.isInteger(r.version)||(r.version=0),Number.isInteger(r.retentionVersions)||(r.retentionVersions=t??Sf);let i=r.version,a=Mi(e,i);await Vn(ye(a),{recursive:!0}),await Ey(a,s),r.version=i+1;let c=null,l=i-r.retentionVersions;if(l>=0)try{await au(Mi(e,l)),c=l}catch(u){if(u?.code!=="ENOENT")throw u}return await Pc(o,r),{skipped:!1,version:i,prunedVersion:c}}async function pt(e){if(io(e))return yf(e.payload);if(rs(e))return yf(jI(e));let t;try{t=await Ie(vf(e),"utf8")}catch(n){if(n?.code==="ENOENT")return zi();throw n}return yf(JSON.parse(t))}function PI(e){if(!Array.isArray(e?.individuals))return e;let t=new Map;for(let s of e.individuals){if(s?.class!==Et||!LI.test(s.id||""))continue;let o=i=>(s.attributes||[]).find(a=>a?.key===i)?.value||"",r=Io(o("subject"),o("predicate"),o("object"));r!==s.id&&(t.set(s.id,r),s.id=r)}if(!t.size)return e;let n=s=>t.get(s)||s;for(let s of e.objectProperties||[])for(let o of s.examples||[])o&&(t.has(o.subject)&&(o.subject=t.get(o.subject)),t.has(o.object)&&(o.object=t.get(o.object)));for(let s of e.individuals){Array.isArray(s?.derived_from)&&s.derived_from.length&&(s.derived_from=s.derived_from.map(n));let o=(s?.attributes||[]).find(r=>r?.prop==="mgx:factJustification");o?.value&&(o.value=o.value.split(" | ").map(r=>r.split(" ").filter(Boolean).map(n).join(" ")).filter(Boolean).join(" | "))}return e}function MI(e){if(!Array.isArray(e?.individuals))return e;let t=(e.objectProperties||[]).find(c=>c?.prop===An),n=new Map;for(let c of t?.examples||[]){if(!c?.subject)continue;let l=n.get(c.subject);l?l.push(c):n.set(c.subject,[c])}let s=new Set,o=new Map,r=[],i=[],a=[];for(let c of e.individuals){if(c?.class!==Et||String(c.id||"").includes("@")){a.push(c);continue}let l=$=>(c.attributes||[]).find(E=>E?.prop===$)?.value||"",u=l("rdf:subject"),d=l("rdf:predicate"),p=l("rdf:object");if(!u||!d||!p){a.push(c);continue}let f=Io(u,d,p),m=l(lt),h=l("mgx:factProvenance"),g=n.get(c.id)||[],b=h?py(h):[];for(let $ of g)b.some(E=>E.sourceId===$.object)||b.push({sourceId:$.object,sourceType:"",tags:[]});b.length||b.push({sourceId:Os,sourceType:"",tags:[]});let y=[];for(let $ of b){let E={id:`${f}@${$.sourceId}`,label:c.label,class:Et,derived_from:Bn(c.derived_from)||[],mentions:Bn(c.mentions)||[],attributes:[{prop:"rdf:type",key:"type",value:"rdf:Statement"},{prop:"rdf:subject",key:"subject",value:u},{prop:"rdf:predicate",key:"predicate",value:d},{prop:"rdf:object",key:"object",value:p},{prop:lt,key:"createdAt",value:Lr($.tags,m,Math.min)||m||Ns()},{prop:Do,key:"sourceId",value:$.sourceId},...$.tags.length?[{prop:"mgx:factProvenance",key:"provenance",value:$.tags.join(" | ")}]:[],...l("mgx:hasProseTokens")?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:l("mgx:hasProseTokens")}]:[],...l("mgx:factQuantifier")?[{prop:"mgx:factQuantifier",key:"quantifier",value:l("mgx:factQuantifier")}]:[],...$.sourceType==="entailed"&&l("mgx:factJustification")?[{prop:"mgx:factJustification",key:"justification",value:l("mgx:factJustification")}]:[]]};if(a.push(E),r.push(E),y.push(E.id),$.sourceId!==Os){let _=g.find(v=>v?.object===$.sourceId);i.push({..._||{},subject:E.id,object:$.sourceId,subjectLabel:E.label,objectLabel:zf($.sourceId)})}}s.add(c.id),o.set(c.id,y)}if(!s.size)return e;t?(t.examples=(t.examples||[]).filter(c=>!s.has(c?.subject)),t.examples.push(...i),t.count=t.examples.length):i.length&&(e.objectProperties=e.objectProperties||[],e.objectProperties.push({predicate:"statedBy",prop:An,count:i.length,examples:i}));for(let c of e.objectProperties||[]){if(c?.prop===An||!c?.examples?.length)continue;let l=[];for(let u of c.examples){let d=s.has(u?.subject)?o.get(u.subject)||[]:[u?.subject],p=s.has(u?.object)?o.get(u.object)||[]:[u?.object];for(let f of d)for(let m of p)l.push({...u,subject:f,object:m})}c.examples=l,c.count=l.length}e.individuals=a,Ry(e);for(let c of r)Cr(e,c);return is(e),e}async function FI(e,t){if(io(e)){e.payload=t;return}if(rs(e)){II(e,t);return}await Vn(ye(vf(e)),{recursive:!0}),await Pc(vf(e),t)}async function DI(e){if(io(e))return e.syllogiseState?structuredClone(e.syllogiseState):null;if(rs(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(jy);return t?.v?JSON.parse(t.v):null}try{return JSON.parse(await Ie(ne(e,Pf),"utf8"))}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function zI(e,t){if(io(e)){e.syllogiseState=structuredClone(t);return}if(rs(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(jy,JSON.stringify(t));return}let n=ne(e,Pf);await Vn(ye(n),{recursive:!0}),await Pc(n,t)}async function UI(e){if(io(e))return e.nodeId||null;if(rs(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(ky);return t?.v&&JSON.parse(t.v).nodeId||null}try{return JSON.parse(await Ie(ne(e,Mf),"utf8")).nodeId||null}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function BI(e,t){if(io(e)){e.nodeId=t;return}if(rs(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(ky,JSON.stringify({nodeId:t}));return}let n=ne(e,Mf);await Vn(ye(n),{recursive:!0}),await Pc(n,{nodeId:t})}function Ry(e){let t=new Map,n=new Map,s=new Map,o=new Map,r=new Map;for(let a of e.individuals||[])if(a?.id&&(t.set(a.id,a),a.class===Or&&n.set(a.id,a),a.class===yn&&kf(r,a),a.class===Et)){let c=Xt(a.id),l=o.get(c);l?l.push(a.id):o.set(c,[a.id])}let i=(e.objectProperties||[]).find(a=>a?.prop===An);for(let a of i?.examples||[]){if(!a?.subject)continue;let c=s.get(a.subject);c?c.push(a.object):s.set(a.subject,[a.object])}return e[jf]={individualsById:t,sourcesById:n,statedByBySubject:s,factRecordsByGroup:o,retractionsByGroup:r},e[jf]}function kf(e,t){let n=Xt(t.id),s=(e.get(n)||[]).filter(o=>o.id!==t.id);s.push(t),e.set(n,s)}function WI(e,t){let n=Jt(e);return n?n.retractionsByGroup.get(t)||[]:(e?.individuals||[]).filter(s=>s?.class===yn&&Xt(s.id)===t)}async function Ps(e,t){let n=await pt(e);Ry(n);let s=await t(n)??n;return KI(s),XI(s),s.proseIndex=dh(s.individuals),await FI(e,s),s}function Ff(e,t){return e?.attributes?.find(n=>n?.prop===lt)?.value||t||Ns()}function Cn(e,t,n,s){e.attributes=(e.attributes||[]).filter(o=>o?.prop!==t),e.attributes.push({prop:t,key:n,value:s})}function Df(e){switch(e?.kind){case"operator":return{id:e.sessionId?`${Oc}:${e.sessionId}`:Oc,type:"operator"};case"teach":return{id:e.sessionId?`${$f}:${e.sessionId}`:$f,type:"teach"};case"teachNode":return{id:`${ay}:${e.nodeId}`,type:"teach"};case"provider":return{id:`src:provider:${e.name}`,type:"provider"};case"corpus":return{id:`src:corpus:${e.name}`,type:"corpus"};case"corpusWeak":return{id:`src:corpus-weak:${e.name}`,type:"corpusWeak"};case"reference":return{id:`src:reference:${e.pack}:${e.article}`,type:"reference"};case"referenceLive":return{id:`src:reference:${e.pack}:${e.article}`,type:"referenceLive"};case"extracted":return{id:`src:extracted:${e.name}`,type:"extracted"};case"optimisticExtract":return{id:`src:optimistic-extract:${e.name}`,type:"optimisticExtract"};case"web":return{id:`src:learned:web:${Si(String(e.url||""))}`,type:"web",url:String(e.url||"")};case"entailed":return{id:`src:entailed:${e.rule}`,type:"entailed",rule:String(e.rule||"")};default:return null}}function GI(e){return bu[e]||null}function VI(e,t,n){let s=Df(t);if(!s)return null;let o=Jt(e),r=o?o.individualsById.get(s.id):e.individuals.find(l=>l?.id===s.id),i=Ff(r,t?.createdAt||n),a={id:s.id,label:zf(s.id),class:Or,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:"mgx:sourceType",key:"sourceType",value:s.type},{prop:lt,key:"createdAt",value:i},...s.url?[{prop:"mgx:sourceUrl",key:"sourceUrl",value:s.url}]:[],...s.rule?[{prop:"mgx:sourceRule",key:"sourceRule",value:s.rule}]:[]]},c=Ls(e,a);return o&&o.sourcesById.set(s.id,c),s.id}function Fc(e){let t=Jt(e),n={};if(t){for(let[s,o]of t.sourcesById)n[s]=o;return n}for(let s of e.individuals)s?.class===Or&&(n[s.id]=s);return n}function _y(e,t){let n=Jt(e);return n?(n.statedByBySubject.get(t)||[]).slice():(e.objectProperties.find(o=>o?.prop===An)?.examples||[]).filter(o=>o?.subject===t).map(o=>o.object)}function HI(e,t,n=Date.now(),s={}){let o=_y(e,t.id),r=(t.attributes||[]).find(c=>c?.prop===lt)?.value||"",{score:i,inputs:a}=xh({sourceIds:o,createdAt:r},Fc(e),{now:n,...Array.isArray(s?.premiseTrusts)?{premiseTrusts:s.premiseTrusts}:{},...typeof s?.ruleConfidence=="number"?{ruleConfidence:s.ruleConfidence}:{}});Cn(t,lr,"trustScore",String(i)),Cn(t,ka,"trustInputs",JSON.stringify(a)),Cn(t,Ks,"updatedAt",new Date(n).toISOString())}function qI(e,t,n=Date.now(),s={}){let[o]=_y(e,t.id),r=o?Fc(e)[o]:null,i=(r?.attributes||[]).find(l=>l?.prop==="mgx:sourceType")?.value||"",a=Ra(i,r);if(i==="entailed"&&Array.isArray(s?.premiseTrusts)&&s.premiseTrusts.length){let l=typeof s.ruleConfidence=="number"?s.ruleConfidence:1;a=Math.max(0,Math.min(1,Math.min(...s.premiseTrusts)*l))}let c=(t.attributes||[]).find(l=>l?.prop===lt)?.value||"";Cn(t,lr,"trustScore",String(a)),Cn(t,ka,"trustInputs",JSON.stringify({sourceType:i,sourceId:o||"",createdAt:c})),Cn(t,Ks,"updatedAt",new Date(n).toISOString())}function Ty(e,t,n,s){t?.class===Et?qI(e,t,n,s):HI(e,t,n,s)}function Cr(e,t,n=Date.now(),s={}){let o=(t.attributes||[]).find(i=>i?.prop==="mgx:factProvenance")?.value||"",r=(t.attributes||[]).find(i=>i?.prop===lt)?.value||new Date(n).toISOString();for(let i of o.split(" | ").filter(Boolean)){let a=Fn(i);if(!a)continue;let c=VI(e,a,r);c&&Lc(e,{predicate:"statedBy",prop:An},{subject:t.id,object:c,subjectLabel:t.label,objectLabel:zf(c)})}Ty(e,t,n,s)}function KI(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=e.objectProperties.find(r=>r?.prop===An),n=new Set((t?.examples||[]).map(r=>r.subject)),s=!1,o=Date.now();for(let r of e.individuals)r?.class!==Et||n.has(r.id)||!(r.attributes||[]).find(a=>a?.prop==="mgx:factProvenance")?.value||(Cr(e,r,o),s=!0);s&&is(e)}function XI(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=bt(e),n=new Set;for(let a of Uy(e))for(let c of a)n.add(c.id);let s=new Map;for(let a of t)for(let c of a.sourceIds){if(!YI(c))continue;let l=s.get(c)||{factsAsserted:0,factsContradicted:0};l.factsAsserted+=1,n.has(a.id)&&(l.factsContradicted+=1),s.set(c,l)}if(!s.size)return;let o=Jt(e);for(let[a,c]of s){let l=o?o.individualsById.get(a):e.individuals.find(u=>u?.id===a);l&&(Cn(l,iy,"sourceReliability",String(Sh(c))),Cn(l,Ks,"updatedAt",new Date().toISOString()))}let r=e.objectProperties.find(a=>a?.prop===An),i=new Set;for(let a of r?.examples||[])s.has(a?.object)&&i.add(a.subject);for(let a of i){let c=o?o.individualsById.get(a):e.individuals.find(l=>l?.id===a);c&&Ty(e,c)}}function JI(e,t,n){if(!mc(n?.id))return n;let s=Ai(n.id);if(!s)return tf(t,n);let o=Fc(e);return tf(t,n,{priorFor:r=>Ra(s,o[r])})}function ry(e,t,n){return n?.class===yn?Uw(t,n):JI(e,t,n)}function Ls(e,t){let n=Jt(e);if(n){let o=n.individualsById.get(t.id);if(o)return Object.assign(o,ry(e,o,t)),o.class===yn&&kf(n.retractionsByGroup,o),o;if(e.individuals.push(t),n.individualsById.set(t.id,t),t.class===yn&&kf(n.retractionsByGroup,t),t.class===Et){let r=Xt(t.id),i=n.factRecordsByGroup.get(r);i?i.push(t.id):n.factRecordsByGroup.set(r,[t.id])}return t}let s=e.individuals.findIndex(o=>o?.id===t.id);return s>=0?(e.individuals[s]=ry(e,e.individuals[s],t),e.individuals[s]):(e.individuals.push(t),t)}function Lc(e,{predicate:t,prop:n},s){let o=e.objectProperties.find(c=>c?.prop===n);o||(o={predicate:t,prop:n,count:0,examples:[]},e.objectProperties.push(o));let r=n===An?Jt(e):null;if(r){let c=r.statedByBySubject.get(s.subject);if(!c||!c.includes(s.object)){o.examples.push({...s,createdAt:s.createdAt||Ns()}),o.count=o.examples.length,c?c.push(s.object):r.statedByBySubject.set(s.subject,[s.object]);return}}let a=(o.examples||[]).find(c=>c?.subject===s.subject&&c?.object===s.object)?.createdAt||s.createdAt||Ns();if(o.examples=(o.examples||[]).filter(c=>!(c?.subject===s.subject&&c?.object===s.object)),o.examples.push({...s,createdAt:a}),o.count=o.examples.length,r){let c=r.statedByBySubject.get(s.subject)||[];c.includes(s.object)||c.push(s.object),r.statedByBySubject.set(s.subject,c)}}function is(e){let t=[Tf,_f,Et,Or,Nr];e.classes=(e.classes||[]).filter(n=>!t.includes(n?.name));for(let n of t){let s=e.individuals.filter(o=>o?.class===n);s.length&&e.classes.push({name:n,count:s.length,sample:s.slice(0,3).map(o=>o.label)})}}function QI(e,t,n=""){let s=`session:${t}`;return e.individuals.some(o=>o?.id===s)||e.individuals.push({id:s,label:String(t).slice(0,8),class:Tf,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:lt,key:"createdAt",value:n||Ns()},...n?[{prop:"mgx:sessionStarted",key:"started",value:n}]:[]]}),s}function Ay(e,{role:t,text:n,ts:s,sessionId:o,sessionStarted:r="",parsed:i=null,replyTo:a=null,createdAt:c=""}){if(!lI.has(t))throw new Error(`utterance role must be "visitor" or "tmct", got ${JSON.stringify(t)}`);if(!o)throw new Error("utterance needs a sessionId");let l=String(s||""),u=As(n),d=`utt:${o}#${l}#${t}`,p=Mc(u)||(t==="visitor"?"a-visitor-said":"a-tmct-said"),f=ja({doc:u}),m=e.individuals.find(y=>y?.id===d),h=Ff(m,c||l),g={id:d,label:p,class:_f,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:"mgx:utteranceRole",key:"role",value:t},{prop:"mgx:utteranceText",key:"text",value:u},{prop:"mgx:utteranceTs",key:"ts",value:l},{prop:lt,key:"createdAt",value:h},...i!=null?[{prop:"mgx:utteranceParsed",key:"parsed",value:JSON.stringify(i)}]:[],...f.length?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:f.join(" ")}]:[]]};Ls(e,g);let b=QI(e,o,r);if(Lc(e,{predicate:"saidInSession",prop:Af},{subject:d,object:b,subjectLabel:p,objectLabel:String(o).slice(0,8)}),a){let y=e.individuals.find($=>$?.id===a);y&&Lc(e,{predicate:"inReplyTo",prop:Cf},{subject:d,object:a,subjectLabel:p,objectLabel:y.label})}return l&&l>String(e.generated_at||"")&&(e.generated_at=l),d}async function ZI(e,t){let n;return await Ps(e,s=>{n=Ay(s,t),is(s)}),{id:n}}async function Cy(e,t){let n=[];return t?.length?(await Ps(e,s=>{for(let o of t)n.push(Ay(s,o));is(s)}),{ids:n}):{ids:n}}async function eO(e,t){t?.length&&await Ps(e,n=>{for(let s of t)for(let o of zo(n,s.factId))Lc(n,{predicate:"canonicalisedFrom",prop:If},{subject:o,object:s.uttId,subjectLabel:s.factLabel,objectLabel:s.uttLabel})})}function zo(e,t){let n=Jt(e);return n?(n.factRecordsByGroup.get(t)||[]).slice():(e?.individuals||[]).filter(s=>s?.class===Et&&Xt(s.id)===t).map(s=>s.id)}function Iy(e,t,n,s=""){let o=py(n);if(o.length===1&&o[0].sourceId===Os&&zo(e,t).length)return[];let r=WI(e,t);if(r.length&&(o=o.filter(a=>!$c(r,`${t}@${a.sourceId}`,Lr(a.tags,s))),!o.length))return o;let i=tO(e,t);return i.length?o.filter(a=>!Mw(i,a.sourceId)):o}function tO(e,t){let n=Jt(e),s=n?n.factRecordsByGroup.get(t):zo(e,t),o=[];for(let r of s||[]){if(!oo(r))continue;let i=ro(e,r);i&&o.push(i)}return o}function Oy(e,t,{quantifier:n,environments:s}){let o=zo(e,t).map(i=>ro(e,i)).filter(i=>i&&!(i.attributes||[]).some(a=>a?.prop===Bi)),r=new Set;if(s){let i=o.filter(a=>(a.attributes||[]).some(c=>c?.prop==="mgx:factJustification"));for(let a of i.length?i:o)Cn(a,"mgx:factJustification","justification",s.map(c=>c.join(" ")).join(" | ")),r.add(a.id)}if(n)for(let i of o)(i.attributes||[]).some(a=>a?.prop==="mgx:factQuantifier")||(Cn(i,"mgx:factQuantifier","quantifier",n),r.add(i.id));return[...r]}function nO(e){let t=0,n=(e.attributes||[]).find(s=>s?.prop===Nc)?.value||"";for(let s of n.split(" ").filter(Boolean)){let o=/#v([1-9][0-9]*)$/.exec(s);o&&(t=Math.max(t,Number(o[1])))}return t+1}function Ny(e,t){let{groupId:n,s,p:o,o:r,label:i,tokens:a,group:c,createdAt:l,observedAt:u,quantifier:d,environments:p}=t,f=`${n}@${c.sourceId}`,m=Jt(e),h=m?m.individualsById.get(f):e.individuals.find(R=>R?.id===f),g=R=>(h?.attributes||[]).find(w=>w?.prop===R)?.value||"",b=g("mgx:factProvenance").split(" | ").filter(Boolean),y={assertedAt:xf(c.tags),observedAt:u},$=null,E=c.tags,_=y.assertedAt||l||Ns(),v=u,S=[],C=d;if(h){let R={assertedAt:xf(b),observedAt:g(Fi)};pI(y,R)?($={head:h,id:`${f}#v${nO(h)}`},S=[$.id]):(E=[...new Set([...b,...c.tags])],_=g(lt)||_,v=u||g(Fi),S=g(Nc).split(" ").filter(Boolean)),C=d||g("mgx:factQuantifier")}return{candidate:{id:f,label:i,class:Et,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"rdf:Statement"},{prop:"rdf:subject",key:"subject",value:s},{prop:"rdf:predicate",key:"predicate",value:o},{prop:"rdf:object",key:"object",value:r},{prop:lt,key:"createdAt",value:_},{prop:Do,key:"sourceId",value:c.sourceId},...E.length?[{prop:"mgx:factProvenance",key:"provenance",value:E.join(" | ")}]:[],...v?[{prop:Fi,key:"observedAt",value:v}]:[],...a.length?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:a.join(" ")}]:[],...C?[{prop:"mgx:factQuantifier",key:"quantifier",value:C}]:[],...p?[{prop:"mgx:factJustification",key:"justification",value:p.map(R=>R.join(" ")).join(" | ")}]:[],...S.length?[{prop:Nc,key:"supersedes",value:S.join(" ")}]:[]]},demote:$}}function sO(e,t){let n=`${t}@${Os}`,s=Jt(e);if((s?!s.individualsById.has(n):!e.individuals.some(r=>r?.id===n))||(e.individuals=e.individuals.filter(r=>r?.id!==n),!s))return;s.individualsById.delete(n);let o=(s.factRecordsByGroup.get(t)||[]).filter(r=>r!==n);o.length?s.factRecordsByGroup.set(t,o):s.factRecordsByGroup.delete(t)}function Ly(e,{candidate:t,demote:n}){let s=[];if(t.id.endsWith(`@${Os}`)||sO(e,Xt(t.id)),n){let o={...n.head,id:n.id,attributes:(n.head.attributes||[]).map(r=>({...r}))};Cn(o,Bi,"supersededBy",t.id),Ls(e,o),s.push(o.id)}return Ls(e,t),s.push(t.id),s}function ro(e,t){let n=Jt(e);return n?n.individualsById.get(t):e.individuals.find(s=>s?.id===t)}function Uf(e,t){let n=new Set(t);if(!n.size)return;e.individuals=(e.individuals||[]).filter(o=>!n.has(o?.id));for(let o of e.objectProperties||[]){let r=o.examples||[],i=r.filter(a=>!n.has(a?.subject)&&!n.has(a?.object));i.length!==r.length&&(o.examples=i,o.count=i.length)}let s=Jt(e);if(s)for(let o of n){s.individualsById.delete(o),s.statedByBySubject.delete(o);let r=Xt(o),i=(s.factRecordsByGroup.get(r)||[]).filter(a=>a!==o);i.length?s.factRecordsByGroup.set(r,i):s.factRecordsByGroup.delete(r)}}function Py(e,t){let n=Jt(e),s=(n?n.factRecordsByGroup.get(t):zo(e,t))||[];if(s.length<8)return[];let o=new Map,r=new Map,i=new Map,a=new Map;for(let u of s.slice()){let d=ro(e,u);if(!d)continue;let p=y=>(d.attributes||[]).find($=>$?.prop===y)?.value||"";if(oo(u)){i.set(Ai(u),d);continue}if(Tr(u)){a.set(p(Do),d);continue}let f=p("mgx:factProvenance"),m=dy(f),h=f.split(" | ").filter(Boolean),g={id:u,sourceId:p(Do)||m.id,assertedAt:Lr(h,p(lt)),record:d};if(p(Bi)){let y=r.get(g.sourceId);y?y.push(g):r.set(g.sourceId,[g]);continue}if(!m.type)continue;let b=o.get(m.type);b?b.push(g):o.set(m.type,[g])}let c=Fc(e),l=[];for(let[u,d]of o){let p=Lw({groupId:t,sourceType:u,heads:d,existing:i.get(u)||null,priorFor:f=>Ra(u,c[f])});if(p){Ls(e,p.rollup),l.push(...p.absorbed);for(let f of p.absorbedSourceIds){for(let h of r.get(f)||[])l.push(h.id);r.delete(f);let m=a.get(f);m&&l.push(m.id),a.delete(f)}}}for(let[u,d]of r){let p=Pw({groupId:t,sourceId:u,leaves:d,existing:a.get(u)||null});if(!p)continue;Ls(e,p.rollup),l.push(...p.absorbed);let f=ro(e,p.rewire);f&&Cn(f,Nc,"supersedes",p.rollup.id)}return l}async function My(e,{subject:t,predicate:n,object:s,provenance:o="",createdAt:r="",observedAt:i="",quantifier:a="",premiseTrusts:c,ruleConfidence:l}={}){let u=q(t),d=Zn(n),p=q(s);if(!u||!d||!p)throw new Error("a fact needs subject, predicate and object");let f=Io(u,d,p),m=`${u} ${d} ${p}`,h=ja({doc:m}),g=As(a);return await Ps(e,async b=>{let y=Iy(b,f,As(o),r);for(let $ of y.length?[]:Oy(b,f,{quantifier:g}))Cr(b,ro(b,$),void 0,{premiseTrusts:c,ruleConfidence:l});for(let $ of y){let E=Ny(b,{groupId:f,s:u,p:d,o:p,label:Mc(m),tokens:h,group:$,createdAt:r,observedAt:i,quantifier:g});await pf(E.candidate);for(let _ of Ly(b,E))Cr(b,ro(b,_),void 0,_===E.candidate.id?{premiseTrusts:c,ruleConfidence:l}:void 0)}Uf(b,Py(b,f)),is(b)}),{id:f}}function oO(e){if(!Array.isArray(e))return;let t=e.some(Array.isArray)?e.filter(Array.isArray):[e],n=[],s=new Set;for(let o of t){let r=o.filter(a=>typeof a=="string"&&a);if(!r.length)continue;let i=[...r].sort().join(" ");s.has(i)||(s.add(i),n.push(r))}return n.length?n:void 0}async function as(e,t){let n=[],s=0;for(let r of t||[]){let i=q(r?.subject),a=Zn(r?.predicate),c=q(r?.object);if(!i||!a||!c){s+=1;continue}let l=`${i} ${a} ${c}`;n.push({id:Io(i,a,c),s:i,p:a,o:c,text:l,tokens:ja({doc:l}),provenance:As(r?.provenance),createdAt:r?.createdAt||"",observedAt:r?.observedAt||"",quantifier:As(r?.quantifier),premiseTrusts:Array.isArray(r?.premiseTrusts)?r.premiseTrusts:void 0,ruleConfidence:typeof r?.ruleConfidence=="number"?r.ruleConfidence:void 0,environments:oO(r?.justification)})}let o=[];return n.length?(await Ps(e,r=>{let i=[],a=new Set,c=new Map;for(let u of n){let d=Iy(r,u.id,u.provenance,u.createdAt);for(let p of d.length?[]:Oy(r,u.id,{quantifier:u.quantifier,environments:u.environments}))a.has(p)||(a.add(p),i.push(p)),(u.premiseTrusts!==void 0||u.ruleConfidence!==void 0)&&c.set(p,{premiseTrusts:u.premiseTrusts,ruleConfidence:u.ruleConfidence});for(let p of d){let f=Ny(r,{groupId:u.id,s:u.s,p:u.p,o:u.o,label:Mc(u.text),tokens:u.tokens,group:p,createdAt:u.createdAt,observedAt:u.observedAt,quantifier:u.quantifier,environments:u.environments});for(let m of Ly(r,f))a.has(m)||(a.add(m),i.push(m));(u.premiseTrusts!==void 0||u.ruleConfidence!==void 0)&&c.set(f.candidate.id,{premiseTrusts:u.premiseTrusts,ruleConfidence:u.ruleConfidence})}o.push(u.id)}for(let u of i)Cr(r,ro(r,u),void 0,c.get(u));let l=[];for(let u of new Set(o))l.push(...Py(r,u));Uf(r,l),is(r)}),{ids:o,appended:o.length,skipped:s}):{ids:o,appended:0,skipped:s}}async function Uc(e,{name:t,kind:n,slots:s,provenance:o="",createdAt:r=""}={}){let i=Fy[n];if(!i)throw new Error(`a rule kind must be one of ${rO.join(", ")}, got ${JSON.stringify(n)}`);let a=q(t);if(!a)throw new Error("a rule needs a name");let c=iO[n]||new Set,l=i.map(([f])=>q(s?.[f])),u=i.filter(([f],m)=>!c.has(f)&&!l[m]);if(u.length)throw new Error(`a ${n} rule needs ${u.map(([f])=>f).join(" + ")}`);if(n===Vi){let f=l[i.findIndex(([h])=>h==="objectRole")],m=l[i.findIndex(([h])=>h==="value")];if(!f&&!m)throw new Error(`a ${n} rule needs an objectRole or a value`)}let d=aO(n,a,l),p=Mc(`${a} = ${n}(${l.join(", ")})`);return await Ps(e,async f=>{let m=f.individuals.find($=>$?.id===d),h=m?.attributes?.find($=>$?.prop==="mgx:factProvenance")?.value||"",g=[...new Set([...h.split(" | "),As(o)].filter(Boolean))],b=Ff(m,r),y={id:d,label:p,class:Nr,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:zc,key:"ruleName",value:a},{prop:Pr,key:"ruleKind",value:n},...i.map(([$,E],_)=>({prop:E,key:$,value:l[_],skip:!l[_]&&c.has($)})).filter($=>!$.skip).map(({skip:$,...E})=>E),{prop:lt,key:"createdAt",value:b},...g.length?[{prop:"mgx:factProvenance",key:"provenance",value:g.join(" | ")}]:[]]};await pf(y),Ls(f,y),Cr(f,f.individuals.find($=>$?.id===d)),is(f)}),{id:d}}function Vf(e,t){let n=q(t);return(e?.individuals||[]).find(s=>s?.class===Nr&&(s.attributes||[]).find(o=>o?.prop===zc)?.value===n)}function cO(e,t){let n=q(t),s=o=>(o.attributes||[]).find(r=>r?.prop===Pr)?.value||"";return(e?.individuals||[]).filter(o=>o?.class===Nr&&(o.attributes||[]).find(r=>r?.prop===zc)?.value===n).sort((o,r)=>s(o).localeCompare(s(r))||String(o.id).localeCompare(String(r.id)))}function Bc(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==Nr)continue;let s=a=>(n.attributes||[]).find(c=>c?.prop===a)?.value,o=s(Pr),r=Fy[o];if(!r)continue;let i={};for(let[a,c]of r)i[a]=s(c)??"";t.push({id:n.id,name:s(zc)||"",kind:o,slots:i,provenance:s("mgx:factProvenance")||""})}return t.sort((n,s)=>n.name.localeCompare(s.name)||n.kind.localeCompare(s.kind)||String(n.id).localeCompare(String(s.id))),t}async function Hf(e,t,n,s,o){let{relationFactsFor:r,renderFactLine:i,factPhrase:a,factTermVariants:c,byTrust:l,rows:u,HAS_PROPERTY_PREDICATE:d,findActionPath:p}=o,f=String(t||"").trim().toLowerCase(),m=c(q,n),h=c(q,s),g=r(f).filter($=>m.has($.fact.subject)&&h.has($.fact.object));if(g.length){let $=g.slice().sort((E,_)=>l(E.fact,_.fact))[0];return{citation:[i($.fact),...$.aliasFacts.map(E=>`${a(E)}${E.provenance?` (source: ${E.provenance})`:""}`)]}}let b=Vf(e,f),y=b?.attributes?.find($=>$.prop===Pr)?.value;if(b&&y===Wi){let $=b.attributes.find(I=>I.prop==="mgx:ruleBase1")?.value,E=b.attributes.find(I=>I.prop==="mgx:ruleBase2")?.value,_=q(n),v=q(s);if(!$||!E||!_||!v)return null;let R=p({entity:_,hopsTaken:0},I=>I.hopsTaken===2&&I.entity===v,I=>{if(I.hopsTaken>=2)return[];let j=I.hopsTaken===0?$:E;return r(j).filter(k=>k.fact.subject===I.entity).map(k=>({action:k,nextState:{entity:k.fact.object,hopsTaken:I.hopsTaken+1}}))},{maxDepth:2,stateKey:I=>`${I.entity}#${I.hopsTaken}`});if(!R)return null;let w=new Set,T=[];for(let I of R.actions){T.push(i(I.fact));for(let j of I.aliasFacts){let k=j.id||`${j.subject}|${j.predicate}|${j.object}`;w.has(k)||(w.add(k),T.push(`${a(j)}${j.provenance?` (source: ${j.provenance})`:""}`))}}return{citation:T}}if(b&&y===Gi){let $=b.attributes.find(x=>x.prop==="mgx:ruleBase1")?.value,E=b.attributes.find(x=>x.prop==="mgx:ruleFilterProperty")?.value;if(!$||!E)return null;let _=await Hf(e,$,n,s,o);if(!_)return null;let v=q(n),S=q(E),C=u.find(x=>x.predicate===d&&x.subject===v&&q(x.object)===S);return C?{citation:[..._.citation,i(C)]}:null}return null}async function Dy(e,t,n,s){let{relationFactsFor:o,renderFactLine:r,factPhrase:i,factTermVariants:a,byTrust:c,rows:l,HAS_PROPERTY_PREDICATE:u,findReachableSet:d}=s,p=String(t||"").trim().toLowerCase(),f=a(q,n),m=o(p).filter(b=>f.has(b.fact.object));if(m.length){let b=new Map;for(let y of m)b.has(y.fact.subject)||b.set(y.fact.subject,[]),b.get(y.fact.subject).push(y);return[...b.entries()].map(([y,$])=>{let E=$.slice().sort((_,v)=>c(_.fact,v.fact))[0];return{subject:y,citation:[r(E.fact),...E.aliasFacts.map(_=>`${i(_)}${_.provenance?` (source: ${_.provenance})`:""}`)]}})}let h=Vf(e,p),g=h?.attributes?.find(b=>b.prop===Pr)?.value;if(h&&g===Wi){let b=h.attributes.find(S=>S.prop==="mgx:ruleBase1")?.value,y=h.attributes.find(S=>S.prop==="mgx:ruleBase2")?.value,$=q(n);return!b||!y||!$?[]:d({entity:$,hopsTaken:0},S=>{if(S.hopsTaken>=2)return[];let C=S.hopsTaken===0?y:b;return o(C).filter(x=>x.fact.object===S.entity).map(x=>({action:x,nextState:{entity:x.fact.subject,hopsTaken:S.hopsTaken+1}}))},{maxDepth:2,stateKey:S=>`${S.entity}#${S.hopsTaken}`}).filter(S=>S.node.hopsTaken===2).map(({node:S,path:C})=>{let x=new Set,R=[];for(let w of C.actions.slice().reverse()){R.push(r(w.fact));for(let T of w.aliasFacts){let I=T.id||`${T.subject}|${T.predicate}|${T.object}`;x.has(I)||(x.add(I),R.push(`${i(T)}${T.provenance?` (source: ${T.provenance})`:""}`))}}return{subject:S.entity,citation:R}})}if(h&&g===Gi){let b=h.attributes.find(v=>v.prop==="mgx:ruleBase1")?.value,y=h.attributes.find(v=>v.prop==="mgx:ruleFilterProperty")?.value;if(!b||!y)return[];let $=await Dy(e,b,n,s),E=q(y),_=[];for(let v of $){let S=q(v.subject),C=l.find(x=>x.predicate===u&&x.subject===S&&q(x.object)===E);C&&_.push({subject:v.subject,citation:[...v.citation,r(C)]})}return _}return[]}function bt(e,t={}){let n=qf(e),s=wy(e),o=[];for(let[r,i]of n.groups){let a=Kf(r,i,n),c=s?.get(r);a.trust=_a(c?c.inputs:a.assertions,t).score,o.push(a)}return o}function qf(e){let t=e?.individuals||[],n=new Map(t.filter(c=>c?.class===Or).map(c=>[c.id,c])),s=(e?.objectProperties||[]).find(c=>c?.prop===An),o=new Map;for(let c of s?.examples||[])o.has(c.subject)||o.set(c.subject,[]),o.get(c.subject).push(c.object);let r=new Map,i=new Map;for(let c of t){if(c?.class===yn){let d=Xt(c.id),p=i.get(d);p?p.push(c):i.set(d,[c]);continue}if(c?.class!==Et||(c.attributes||[]).some(d=>d?.prop===Bi)||Tr(c.id))continue;let l=Xt(c.id),u=r.get(l);u?u.push(c):r.set(l,[c])}for(let[c,l]of i){let u=r.get(c);if(!u)continue;let d=u.filter(p=>!$c(l,p.id,Lr(os(p,"mgx:factProvenance").split(" | ").filter(Boolean),os(p,lt))));d.length!==u.length&&(d.length?r.set(c,d):r.delete(c))}let a=new Map;for(let[c,l]of r){l.sort((p,f)=>p.id<f.id?-1:p.id>f.id?1:0);let u=Ef(Di(l[0],"subject"),Di(l[0],"predicate")),d=a.get(u);d?d.push(c):a.set(u,[c])}return{groups:r,groupsByPair:a,statedByRecord:o,sourceTypeOf:c=>(n.get(c)?.attributes||[]).find(l=>l?.prop==="mgx:sourceType")?.value||""}}function Kf(e,t,n){let{statedByRecord:s,sourceTypeOf:o}=n,r=os,i=Di,a=[],c=[],l=[],u=new Set,d=[],p=new Set,f="";for(let g of t){if(oo(g.id)){let S=Ai(g.id),C=hc(g);for(let x of C)c.includes(x)||(c.push(x),S&&l.push(S));a.push({id:g.id,sourceId:"",sourceType:S,provenance:"",createdAt:r(g,ts),ownTrust:Number(r(g,_r))||0,assertedAt:r(g,ns),rollup:{count:Number(r(g,Ti))||C.length,sourceIds:C,earliest:r(g,ts),latest:r(g,ns)}});continue}let b=r(g,"mgx:factProvenance").split(" | ").filter(Boolean);for(let S of b)u.add(S);let[y]=s.get(g.id)||[],$=y||r(g,Do),E=o($);y&&!c.includes(y)&&(c.push(y),E&&l.push(E));let _=r(g,lt),v=r(g,Fi);a.push({id:g.id,sourceId:$,sourceType:E,provenance:b.join(" | "),createdAt:_,...v?{observedAt:v}:{},ownTrust:Number(r(g,lr))||0,assertedAt:Lr(b,_)}),f=f||i(g,"quantifier");for(let S of i(g,"justification").split(" | ")){let C=S.split(" ").filter(Boolean);if(!C.length)continue;let x=C.join(" ");p.has(x)||(p.add(x),d.push(C))}}let m=[],h=new Set;for(let g of d)for(let b of g)h.has(b)||(h.add(b),m.push(b));return{id:e,subject:i(t[0],"subject"),predicate:i(t[0],"predicate"),object:i(t[0],"object"),provenance:[...u].sort().join(" | "),quantifier:f,sourceIds:c,sourceTypes:l,environments:d,justification:m,assertions:a}}function lO(e){let t=os(e,Do);if(t)return t;let n=String(e?.id||""),s=n.indexOf("@");if(s<0)return"";let o=n.slice(s+1),r=o.indexOf("#");return r<0?o:o.slice(0,r)}async function zy(e,t,{provenance:n="",retractedAt:s=""}={}){let o=new Set((t||[]).filter(Boolean)),r=[],i=[];if(!o.size)return{removed:r,records:i};let a=s||Ns();return await Ps(e,c=>{let l=new Set,u=new Set,d=new Map;c.individuals=(c.individuals||[]).filter(p=>{if(p?.class!==Et)return!0;let f=Xt(p.id),m=o.has(p.id)?p.id:o.has(f)?f:"";if(!m)return!0;u.add(m),l.add(p.id);let h=lO(p),g=`${f}\0${h}`,b=os(p,"mgx:factProvenance"),y=d.get(g);return y?(y.ids.push(p.id),b&&y.tags.push(b)):d.set(g,{groupId:f,sourceId:h,ids:[p.id],tags:b?[b]:[],template:{label:p.label||"",subject:os(p,"rdf:subject"),predicate:os(p,"rdf:predicate"),object:os(p,"rdf:object")}}),!1});for(let p of u)r.push(p);if(r.length){for(let p of l)i.push(p);for(let p of c.objectProperties||[]){let f=p.examples||[];p.examples=f.filter(m=>!l.has(m?.subject)&&!l.has(m?.object)),p.count=p.examples.length}for(let p of d.values()){let f=zw({groupId:p.groupId,sourceId:p.sourceId,recordIds:p.ids,retractedAt:a,template:p.template,provenance:[...p.tags,n].filter(Boolean).join(" | ")});f&&Ls(c,f)}is(c)}}),{removed:r,records:i}}function uO(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==yn)continue;let s=vc(n);s&&t.push(s)}return t.sort((n,s)=>n.id<s.id?-1:n.id>s.id?1:0)}async function dO(e,t){let n=[];for(let o of t||[]){let r=xc(o);r&&n.push(r)}let s=[];return n.length?(await Ps(e,o=>{let r=new Map;for(let a of n){let c=Ls(o,a),l=Xt(c.id),u=r.get(l);u?u.push(c):r.set(l,[c])}let i=new Set;for(let[a,c]of r)for(let l of zo(o,a)){let u=ro(o,l);if(!u)continue;let d=os(u,"mgx:factProvenance").split(" | ").filter(Boolean);$c(c,l,Lr(d,os(u,lt)))&&i.add(l)}if(i.size){Uf(o,i);for(let a of i)s.push(a)}is(o)}),{merged:n.length,removed:s}):{merged:0,removed:s}}function fO(e,{self:t="",acknowledgedBy:n=null}={}){let s=Ec(bt(e)),o=[];for(let r of e?.individuals||[])r?.class===yn&&r.id&&o.push(r.id);return{roster:s,retirable:Sc({recordIds:o,roster:s,self:t,acknowledgedBy:n})}}async function pO(e,t){let n=new Set((t||[]).filter(Boolean)),s=[];return n.size?(await Ps(e,o=>{let r=new Set;if(o.individuals=(o.individuals||[]).filter(a=>a?.class!==yn||!n.has(a.id)?!0:(r.add(a.id),!1)),!r.size)return;for(let a of r)s.push(a);let i=Jt(o);if(i)for(let a of r){i.individualsById.delete(a);let c=Xt(a),l=(i.retractionsByGroup.get(c)||[]).filter(u=>!r.has(u.id));l.length?i.retractionsByGroup.set(c,l):i.retractionsByGroup.delete(c)}is(o)}),{retired:s}):{retired:s}}function Uy(e,{floor:t=mO}={}){let n=bt(e).filter(r=>r.trust>=t),s=new Map;for(let r of n){if(dc(r.predicate)===Hd)continue;let i=`${r.subject} ${r.predicate}`;s.has(i)||s.set(i,[]),s.get(i).push(r)}let o=[];for(let r of s.values()){if(new Set(r.map(a=>a.object)).size<2)continue;let i=dc(r[0].predicate);i!==qd&&!Yd(r,i).contested||o.push(r.slice().sort((a,c)=>c.trust-a.trust||a.object.localeCompare(c.object)))}return o.sort((r,i)=>`${r[0].subject} ${r[0].predicate}`.localeCompare(`${i[0].subject} ${i[0].predicate}`))}var Ir,Rf,_f,Et,Tf,Or,Nr,Af,Cf,cI,An,If,iy,Oc,$f,ay,lI,sy,uI,vf,Of,cy,dI,Os,Fi,Do,Nc,Bi,hy,os,Di,Ef,gy,wy,gI,vI,oy,Bn,Sy,Sf,OI,yf,LI,Pf,jy,Mf,ky,jf,Jt,Mc,Ns,zf,YI,Wi,Gi,Bf,Wf,Dc,Vi,Gf,rO,zc,Pr,Fy,iO,aO,mO,Mr,hO,gO,qe=M(()=>{Pt();Je();qs();it();it();Dn();jw();Dn();uc();nf();lf();ff();Vw();nf();lf();ff();Ir=ne(".tmct","memory"),Rf=ne(Ir,"graph.json"),_f="Utterance",Et="Fact",Tf="Session",Or="Source",Nr="Rule",Af="mgx:saidInSession",Cf="mgx:inReplyTo",cI="mgx:derivedFrom",An="mgx:statedBy",If="mgx:canonicalisedFrom",iy="mgx:sourceReliability",Oc="src:operator-chat",$f="src:teach-chat",ay="src:teach-node",lI=new Set(["visitor","tmct"]),sy=48,uI=[{prop:"rdf:type",note:"rdf-ish typing attribute: owl:NamedIndividual (utterances/sessions) or rdf:Statement (reified facts)"},{prop:"mgx:utteranceRole",note:"who said it: visitor (an a-visitor-said item) or tmct (the response alongside it)"},{prop:"mgx:utteranceText",note:"the utterance's normalized text (capped)"},{prop:"mgx:utteranceTs",note:"when it was said, ISO-8601 (the chat turn timestamp)"},{prop:"mgx:utteranceParsed",note:"optional JSON of the parse the interpretation pipeline produced for this request"},{prop:Af,predicate:"saidInSession",note:"Utterance \u2192 Session it was said in; runtime observation, owned (no SEON term)"},{prop:Cf,predicate:"inReplyTo",note:"tmct Utterance \u2192 the visitor Utterance it answers (the Q/A pairing)"},{prop:"rdf:subject",note:"reified fact: the triple's subject term"},{prop:"rdf:predicate",note:"reified fact: the triple's predicate term"},{prop:"rdf:object",note:"reified fact: the triple's object term"},{prop:"mgx:factProvenance",note:"LEGACY COMPAT SHIM: the ' | '-joined provenance tag string a fact came from; the source-of-truth is now the mgx:statedBy edges derived from it"},{prop:"mgx:sourceId",note:"the assertion key a Fact record is filed under \u2014 the Source id of the ONE party asserting it, which is also the @-suffix of the record's own id. `src:none` when no tag names a Source, so every record has a key rather than a hole"},{prop:"mgx:observedAt",note:"OPTIONAL valid time: when the asserting party WITNESSED the claim, as against mgx:createdAt's transaction time (when this store recorded it). A stale article read today loses to an eyewitness report from yesterday. Stored only when a caller supplies one \u2014 never fabricated, never backfilled"},{prop:"mgx:supersedes",note:"the record id(s) this one replaced when its own source re-asserted the triple with a newer embedded timestamp. A space-joined LIST; absent, never empty, until the first supersession"},{prop:"mgx:supersededBy",note:"the record id(s) that replaced this one. Its presence is what makes a record a demoted leaf rather than a live head, and the group fold skips it: a source's past belief is not a second vote for the present one. A LIST, because one source with two live replicas can fork before they sync"},{prop:"mgx:factQuantifier",note:"OPTIONAL: the quantifier word a plural class-membership teach used ('every'/'some'/'a few'), for literal recall by 'how many Xs are Ys' \u2014 never real cardinality counting"},{prop:"mgx:factJustification",note:"an entailed Fact's supporting premise fact ids: ' | '-separated environments, one space-separated premise-id list per independent derivation, capped by syllogise's maxEnvironments knob; a value with no ' | ' is a single environment"},{prop:"mgx:ruleName",note:"a taught Rule's own name (e.g. 'grandparent') \u2014 the query-dispatcher's lookup key, PLAN_TAUGHT_RELATIONS.md \xA72/\xA73"},{prop:"mgx:ruleKind",note:"a taught Rule's SHAPE tag \u2014 the closed vocabulary compose2 | filter | recursive (structural, like 'Fact'/'Rule' themselves, never a domain word)"},{prop:"mgx:ruleBase1",note:"compose2: the first hop's base relation name; filter: the base rule/relation being filtered (same 'base relation' role in both kinds, so the name is shared)"},{prop:"mgx:ruleBase2",note:"compose2 only: the second hop's base relation name"},{prop:"mgx:ruleFilterProperty",note:"filter only: the property literal candidates are filtered by (an mgx:hasProperty-shaped Fact lookup)"},{prop:"mgx:ruleBaseCase",note:"recursive only: the base-case relation name (hop zero)"},{prop:"mgx:ruleRecStep",note:"recursive only: the self-referential recursive-step relation name"},{prop:lt,note:"when an individual was FIRST written, ISO-8601 (first-write-wins on upsert); the audit 'when', the recency input to trust, the novelty signal"},{prop:Ks,note:"an audit / last-modified stamp: when an individual's OWN attributes were last mutated in place (upsertSession, recomputeFactTrust, recomputeSourceReliability) \u2014 most individuals never carry it at all. NOT transaction time: a mutable stamp cannot record when the previous version stopped being current, so tmct is not bitemporal"},{prop:cI,predicate:"derivedFrom",note:"umbrella: a Fact derived from a Source (or another Fact). ext ref prov:wasDerivedFrom (UNVERIFIED-pending-web-check)"},{prop:An,predicate:"statedBy",note:"subPropertyOf derivedFrom: a Source directly asserts this Fact (one edge per independent source \u2014 replaces the factProvenance union)"},{prop:If,predicate:"canonicalisedFrom",note:"subPropertyOf derivedFrom: a canonical Fact cleaned from a raw Block/Source, never replacing it"},{prop:"mgx:sourceType",note:"a Source's kind: operator | teach | provider | corpus | corpusWeak | reference | referenceLive | extracted | optimisticExtract | web | entailed (the trust-prior key)"},{prop:"mgx:sourceUrl",note:"a web Source's URL"},{prop:"mgx:sourceRule",note:"an entailed Source's rule id"},{prop:"mgx:sourceReliability",note:"actor-level (session-scoped) trust nudge in [0.5,1.5], neutral 1.0 when absent \u2014 materialised by recomputeSourceReliability from a session's asserted-vs-contradicted track record (memory/trust.mjs's sessionReliabilityFrom); folds into computeTrust's per-source prior"},{prop:lr,note:"materialised trust cache in [0,1] \u2014 pure function of a fact's Sources + createdAt (memory/trust.mjs); invalidated when a statedBy edge is added"},{prop:ka,note:"JSON of the inputs the trust score was computed from (source-type multiset, corroboration count, createdAt, recency) \u2014 makes the score auditable"},{prop:"mgx:hasProseTokens",note:"prose tokens (prose.mjs tokenizer) backing the payload's proseIndex"},{prop:"mgx:sessionStarted",note:"session anchor: when the session started, ISO-8601"},{prop:"rdf:predicate",prefix:Er,note:"a reified fact's predicate carries its POLARITY: mgxneg:capableOf is the negative twin of mgx:capableOf ('a penguin cannot fly'). Polarity cannot be a separate property \u2014 the fact id hashes (subject, predicate, object), so both polarities would share one id and union their statedBy edges (memory/capability.mjs)"}];vf=e=>Mi(e),Of="memory",cy="sqlite";dI=`
108
108
  CREATE TABLE IF NOT EXISTS meta (k TEXT PRIMARY KEY, v TEXT NOT NULL);
109
109
  CREATE TABLE IF NOT EXISTS individuals (id TEXT PRIMARY KEY, ord INTEGER NOT NULL, class TEXT, label TEXT, json TEXT NOT NULL);
110
110
  CREATE TABLE IF NOT EXISTS relations (prop TEXT PRIMARY KEY, ord INTEGER NOT NULL, predicate TEXT, count INTEGER);
@@ -143,89 +143,89 @@ CREATE TABLE IF NOT EXISTS fact_object_supersessions (
143
143
  recorded_at TEXT NOT NULL,
144
144
  PRIMARY KEY (subject, predicate, ord)
145
145
  );
146
- `,Os="src:none",Li="mgx:observedAt",Fo="mgx:sourceId",Ic="mgx:supersedes",Di="mgx:supersededBy";dy="INSERT OR REPLACE INTO facts(id, triple_hash, subject, predicate, object, source_id, source_type, trust_score, created_at, observed_at, superseded_by, json) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";os=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",Pi=(e,t)=>(e?.attributes||[]).find(n=>n?.key===t)?.value||"",$f=(e,t)=>`${e}\0${t}`;fy=Symbol("materialised fact_heads index");my=e=>e?.[fy]||null,rI="INSERT OR REPLACE INTO fact_heads(triple_hash, trust_base, inputs_json, updated_at) VALUES (?, ?, ?, ?)";uI=new Set(["subject","object","subjectLabel","objectLabel"]),ey=!1;Bn=e=>e===void 0?e:structuredClone(e);$y=ne(Ir,"manifest.json"),vf=5,xI=e=>ne(e,$y);gf=e=>kI(jI(e)),SI=/^fact:[0-9a-f]{8}$/;Of=ne(Ir,"syllogise-state.json"),vy="syllogiseState";Nf=ne(Ir,"node-id.json"),xy="nodeId";xf=Symbol("mutateMemory lookup index");Xt=e=>e?.[xf]||null;Lc=e=>e.length>Zw?e.slice(0,Zw-1)+"\u2026":e,Ns=()=>new Date().toISOString();Mf=e=>String(e).replace(/^src:/,"");FI=e=>typeof e=="string"&&(e.startsWith(`${Cc}:`)||e.startsWith(`${bf}:`)||e.startsWith(`${sy}:`));zi="compose2",Ui="filter",Df="recursive",zf="action-signature",Mc="action-precond",Bi="action-effect",Uf="action-constraint",KI=Object.freeze([zi,Ui,Df,zf,Mc,Bi,Uf]),Fc="mgx:ruleName",Pr="mgx:ruleKind",Ny={[zi]:[["base1","mgx:ruleBase1"],["base2","mgx:ruleBase2"]],[Ui]:[["base","mgx:ruleBase1"],["property","mgx:ruleFilterProperty"]],[Df]:[["baseCase","mgx:ruleBaseCase"],["recStep","mgx:ruleRecStep"]],[zf]:[["subjectClass","mgx:ruleActionSubjectClass"],["targetClass","mgx:ruleActionTargetClass"]],[Mc]:[["shape","mgx:ruleActionPrecondShape"],["predicate","mgx:ruleActionPrecondPredicate"],["role","mgx:ruleActionPrecondRole"],["scope","mgx:ruleActionPrecondScope"],["value","mgx:ruleActionPrecondValue"],["negate","mgx:ruleActionPrecondNegate"]],[Bi]:[["predicate","mgx:ruleActionEffectPredicate"],["subjectRole","mgx:ruleActionEffectSubject"],["objectRole","mgx:ruleActionEffectObject"],["value","mgx:ruleActionEffectValue"]],[Uf]:[["left","mgx:ruleActionConstraintLeft"],["right","mgx:ruleActionConstraintRight"],["guard","mgx:ruleActionConstraintGuard"]]},YI={[Mc]:new Set(["value","negate"]),[Bi]:new Set(["objectRole","value"])},XI=(e,t,n)=>`rule:${vi([e,t,...n].join("\0"))}`;sO=.5,Mr="mgx:hasA",oO="mgx:capableOf",rO=Vd});async function An(e,t=null){try{if(t)return bt(await pt(t));let{dir:n,close:s}=await io(ye(ye(e.graphFile)));try{return bt(await pt(n))}finally{await s()}}catch{return[]}}function Dy(e){let t=[...new Set(e.map(s=>s.provenance).filter(Boolean))];return t.length?`provenance: ${t.slice(0,2).join("; ")}${t.length>2?`, +${t.length-2} more source(s)`:""}`:"provenance: memory/corpus facts"}function Uc(e,t){let n=q(t),s=e.filter(a=>Fy.has(a.predicate)&&a.object===n);if(!s.length)return null;let o=[...new Set(s.map(a=>a.subject))].sort(),r=o.slice(0,zo),i=o.length>zo?`
147
- \u2026+${o.length-zo} more`:"";return`"${t}" is not a code-map entity \u2014 answering from memory/corpus facts. ${o.length} known subclass(es):
146
+ `,Os="src:none",Fi="mgx:observedAt",Do="mgx:sourceId",Nc="mgx:supersedes",Bi="mgx:supersededBy";hy="INSERT OR REPLACE INTO facts(id, triple_hash, subject, predicate, object, source_id, source_type, trust_score, created_at, observed_at, superseded_by, json) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";os=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",Di=(e,t)=>(e?.attributes||[]).find(n=>n?.key===t)?.value||"",Ef=(e,t)=>`${e}\0${t}`;gy=Symbol("materialised fact_heads index");wy=e=>e?.[gy]||null,gI="INSERT OR REPLACE INTO fact_heads(triple_hash, trust_base, inputs_json, updated_at) VALUES (?, ?, ?, ?)";vI=new Set(["subject","object","subjectLabel","objectLabel"]),oy=!1;Bn=e=>e===void 0?e:structuredClone(e);Sy=ne(Ir,"manifest.json"),Sf=5,OI=e=>ne(e,Sy);yf=e=>MI(PI(e)),LI=/^fact:[0-9a-f]{8}$/;Pf=ne(Ir,"syllogise-state.json"),jy="syllogiseState";Mf=ne(Ir,"node-id.json"),ky="nodeId";jf=Symbol("mutateMemory lookup index");Jt=e=>e?.[jf]||null;Mc=e=>e.length>sy?e.slice(0,sy-1)+"\u2026":e,Ns=()=>new Date().toISOString();zf=e=>String(e).replace(/^src:/,"");YI=e=>typeof e=="string"&&(e.startsWith(`${Oc}:`)||e.startsWith(`${$f}:`)||e.startsWith(`${ay}:`));Wi="compose2",Gi="filter",Bf="recursive",Wf="action-signature",Dc="action-precond",Vi="action-effect",Gf="action-constraint",rO=Object.freeze([Wi,Gi,Bf,Wf,Dc,Vi,Gf]),zc="mgx:ruleName",Pr="mgx:ruleKind",Fy={[Wi]:[["base1","mgx:ruleBase1"],["base2","mgx:ruleBase2"]],[Gi]:[["base","mgx:ruleBase1"],["property","mgx:ruleFilterProperty"]],[Bf]:[["baseCase","mgx:ruleBaseCase"],["recStep","mgx:ruleRecStep"]],[Wf]:[["subjectClass","mgx:ruleActionSubjectClass"],["targetClass","mgx:ruleActionTargetClass"]],[Dc]:[["shape","mgx:ruleActionPrecondShape"],["predicate","mgx:ruleActionPrecondPredicate"],["role","mgx:ruleActionPrecondRole"],["scope","mgx:ruleActionPrecondScope"],["value","mgx:ruleActionPrecondValue"],["negate","mgx:ruleActionPrecondNegate"]],[Vi]:[["predicate","mgx:ruleActionEffectPredicate"],["subjectRole","mgx:ruleActionEffectSubject"],["objectRole","mgx:ruleActionEffectObject"],["value","mgx:ruleActionEffectValue"]],[Gf]:[["left","mgx:ruleActionConstraintLeft"],["right","mgx:ruleActionConstraintRight"],["guard","mgx:ruleActionConstraintGuard"]]},iO={[Dc]:new Set(["value","negate"]),[Vi]:new Set(["objectRole","value"])},aO=(e,t,n)=>`rule:${Si([e,t,...n].join("\0"))}`;mO=.5,Mr="mgx:hasA",hO="mgx:capableOf",gO=Kd});async function In(e,t=null){try{if(t)return bt(await pt(t));let{dir:n,close:s}=await ao(ye(ye(e.graphFile)));try{return bt(await pt(n))}finally{await s()}}catch{return[]}}function Wy(e){let t=[...new Set(e.map(s=>s.provenance).filter(Boolean))];return t.length?`provenance: ${t.slice(0,2).join("; ")}${t.length>2?`, +${t.length-2} more source(s)`:""}`:"provenance: memory/corpus facts"}function Wc(e,t){let n=q(t),s=e.filter(a=>By.has(a.predicate)&&a.object===n);if(!s.length)return null;let o=[...new Set(s.map(a=>a.subject))].sort(),r=o.slice(0,Uo),i=o.length>Uo?`
147
+ \u2026+${o.length-Uo} more`:"";return`"${t}" is not a code-map entity \u2014 answering from memory/corpus facts. ${o.length} known subclass(es):
148
148
  ${r.join(`
149
149
  `)}${i}
150
- (${Dy(s)})`}function Bc(e,t){let n=q(t),s=e.filter(a=>Fy.has(a.predicate)&&(a.subject===n||a.object===n));if(!s.length)return null;let o=[...new Set(s.filter(a=>a.subject===n).map(a=>a.object))],r=[...new Set(s.filter(a=>a.object===n).map(a=>a.subject))].sort(),i=[`"${t}" is not a code-map entity \u2014 answering from memory/corpus facts.`];if(o.length&&i.push(`is a: ${o.slice(0,zo).join(", ")}`),r.length){let a=r.length>zo?`, +${r.length-zo} more`:"";i.push(`known subclasses (${r.length}): ${r.slice(0,zo).join(", ")}${a}`)}return i.push(`(${Dy(s)})`),i.join(`
151
- `)}var Fy,zo,Uo=M(()=>{Je();qe();Fy=new Set(["rdfs:subClassOf","rdf:type"]),zo=40});async function zy(e,{graph:t,svc:n,config:s}){let o=ft(e,"symbol"),{match:r,candidates:i}=hn(n.graph,o);if(r)return ju(t,r,{candidates:i});let a=Bc(await An(s),o);if(a)return a;Ft(n,o,"symbol")}var Uy=M(()=>{De();Uo();tt()});async function By(e,{graph:t,svc:n,repoRoot:s}){let o=ft(e,"symbol"),{match:r,candidates:i}=Ft(n,o,"symbol"),a=Vt(r);if(!a)throw new Oe(`"${r.label}" (${r.class||"Entity"}) has no source span in the graph \u2014 it is likely a module. Use tmct_describe for its contents, then tmct_snippet one of the functions/classes it defines.`);let c;try{c=await Ts({readFile:Ce,repoRoot:s,path:a.path,start:a.start,end:a.end,maxLines:$i})}catch(g){throw g instanceof Oe?g:new Oe(`could not read ${a.path} (${g?.code||g?.message||g})`)}let{text:l,truncated:u}=c,d=a.end>a.start?`${a.start}-${a.end}`:`${a.start}`,p=`${r.label} \u2014 ${r.class||"Entity"} @ ${a.path}:${d}`,f=u?`
152
- \u2026 (truncated to ${$i} lines; full span ${d})`:"",m=i.length?`
153
- (other matches: ${i.map(g=>g.label).join(", ")})`:"",h=_u(t,r);return`${p}
150
+ (${Wy(s)})`}function Gc(e,t){let n=q(t),s=e.filter(a=>By.has(a.predicate)&&(a.subject===n||a.object===n));if(!s.length)return null;let o=[...new Set(s.filter(a=>a.subject===n).map(a=>a.object))],r=[...new Set(s.filter(a=>a.object===n).map(a=>a.subject))].sort(),i=[`"${t}" is not a code-map entity \u2014 answering from memory/corpus facts.`];if(o.length&&i.push(`is a: ${o.slice(0,Uo).join(", ")}`),r.length){let a=r.length>Uo?`, +${r.length-Uo} more`:"";i.push(`known subclasses (${r.length}): ${r.slice(0,Uo).join(", ")}${a}`)}return i.push(`(${Wy(s)})`),i.join(`
151
+ `)}var By,Uo,Bo=M(()=>{Je();qe();By=new Set(["rdfs:subClassOf","rdf:type"]),Uo=40});async function Gy(e,{graph:t,svc:n,config:s}){let o=ft(e,"symbol"),{match:r,candidates:i}=hn(n.graph,o);if(r)return Ru(t,r,{candidates:i});let a=Gc(await In(s),o);if(a)return a;Ft(n,o,"symbol")}var Vy=M(()=>{De();Bo();tt()});async function Hy(e,{graph:t,svc:n,repoRoot:s}){let o=ft(e,"symbol"),{match:r,candidates:i}=Ft(n,o,"symbol"),a=Vt(r);if(!a)throw new Ne(`"${r.label}" (${r.class||"Entity"}) has no source span in the graph \u2014 it is likely a module. Use tmct_describe for its contents, then tmct_snippet one of the functions/classes it defines.`);let c;try{c=await Ts({readFile:Ie,repoRoot:s,path:a.path,start:a.start,end:a.end,maxLines:Ei})}catch(g){throw g instanceof Ne?g:new Ne(`could not read ${a.path} (${g?.code||g?.message||g})`)}let{text:l,truncated:u}=c,d=a.end>a.start?`${a.start}-${a.end}`:`${a.start}`,p=`${r.label} \u2014 ${r.class||"Entity"} @ ${a.path}:${d}`,f=u?`
152
+ \u2026 (truncated to ${Ei} lines; full span ${d})`:"",m=i.length?`
153
+ (other matches: ${i.map(g=>g.label).join(", ")})`:"",h=Au(t,r);return`${p}
154
154
  ${l}${f}${h?`
155
- ${h}`:""}${m}`}var Wy=M(()=>{Lt();Kt();Qa();De();tt()});var Gy,Vy=M(()=>{De();tt();Gy=gt(Yh)});function Hy(e,{graph:t,svc:n}){let{match:s}=Ft(n,ft(e,"module"),"module");return Fh(t,s)}var qy=M(()=>{De();tt()});async function Ky(e,{graph:t,config:n}){let s=String(e?.query||"").trim(),o=String(e?.kind||"").trim();if(!s&&!o)throw new Oe("query is required");let r=qh(t,s,{kind:o,decorator:String(e?.decorator||"").trim(),name:String(e?.name||"").trim(),toolNamePrefix:n?.toolNamePrefix});if(!o&&/^no module matches/.test(r)){let i=Bc(await An(n),s);if(i)return i}return r}var Yy=M(()=>{Kt();De();Uo()});async function Xy(e,{graph:t,svc:n,config:s}){let o=ft(e,"class"),{match:r}=hn(n.graph,o);if(r)return Kh(t,r,{toolNamePrefix:s?.toolNamePrefix});let i=Uc(await An(s),o);if(i)return i;Ft(n,o,"class")}var Jy=M(()=>{De();Uo();tt()});async function Qy(e,{graph:t,svc:n,config:s}){let o=ft(e,"class"),{match:r}=hn(n.graph,o);if(r)return Xh(t,r);let i=Uc(await An(s),o);if(i)return i;Ft(n,o,"class")}var Zy=M(()=>{De();Uo();tt()});function e$(e,{conceptBase:t="concept:",relationMap:n=aO}={}){let s=new Set(n.synonym||[]),o=new Set(n.related||[]),r=new Map,i=g=>{r.has(g)||r.set(g,g)},a=g=>{let b=g;for(;r.get(b)!==b;)b=r.get(b);for(;r.get(g)!==b;){let y=r.get(g);r.set(g,b),g=y}return b},c=(g,b)=>{let y=a(g),$=a(b);y!==$&&(y<$?r.set($,y):r.set(y,$))},l=[];for(let g of e){let b=g.predicate;if(!s.has(b)&&!o.has(b))continue;let y=q(g.subject),$=q(g.object);!y||!$||(i(y),i($),s.has(b)?c(y,$):l.push({s:y,o:$}))}let u=g=>t+g.replace(/ /g,"_"),d=new Map;for(let g of r.keys()){let b=a(g);d.has(b)||d.set(b,new Set),d.get(b).add(g)}let p=[];for(let[g,b]of d){let y=[...b].sort();p.push({id:u(g),prefLabel:g,altLabels:y.filter($=>$!==g)})}p.sort((g,b)=>g.id<b.id?-1:g.id>b.id?1:0);let f=new Set,m=[];for(let{s:g,o:b}of l){let y=u(a(g)),$=u(a(b));if(y===$)continue;let E=y<$?`${y}\0${$}`:`${$}\0${y}`;f.has(E)||(f.add(E),m.push({subject:y,object:$}))}return m.sort((g,b)=>`${g.subject}${g.object}`<`${b.subject}${b.object}`?-1:1),{concepts:p,related:m,conceptIdForTerm:g=>{let b=q(g);return r.has(b)?u(a(b)):null},namespace:iO}}function Hf(e,t,n={}){let s=e$(e,n),o=s.conceptIdForTerm(t);if(!o)return null;let r=new Map(s.concepts.map(u=>[u.id,u])),i=r.get(o),a=q(t),c=[i.prefLabel,...i.altLabels].filter(u=>u!==a),l=s.related.filter(u=>u.subject===o||u.object===o).map(u=>r.get(u.subject===o?u.object:u.subject)).filter(Boolean);return{conceptId:o,prefLabel:i.prefLabel,altLabels:i.altLabels,synonyms:c,related:l}}var iO,aO,Wc=M(()=>{it();iO="http://www.w3.org/2004/02/skos/core#",aO={synonym:["mgx:synonym"],related:["mgx:relatedTo","mgx:similarTo"]}});async function qf(e,{config:t,memoryBackend:n=null}){let s=ft(e,"term"),o=Hf(await An(t,n),s);if(!o)throw new Oe(`no synonym or related facts for "${s}" in the memory graph. This view answers where the store holds mgx:synonym / mgx:relatedTo facts (a corpus import seeds them).`);let r=[`${o.prefLabel} [${o.conceptId}]`];return o.synonyms.length&&r.push(`synonyms (skos:altLabel): ${o.synonyms.join(", ")}`),o.related.length&&r.push(`related (skos:related): ${o.related.map(i=>i.prefLabel).join(", ")}`),r.push("(from the memory graph's mgx:synonym / mgx:relatedTo / mgx:similarTo facts)"),to({content:r.join(`
156
- `),data:o})}var t$=M(()=>{Kt();Wc();Uo();tt();qf.ownsGraphLoad=!0});function vO(e,t){let n=[];for(let s of t||[])s?.predicate===cO&&q(s.subject)===e&&n.push(q(s.object));return n}function Gc(e,t){let n=q(e),s=new Set,o=[n],r=[];for(;o.length;){let i=o.shift();if(!s.has(i)){s.add(i),r.push(i);for(let a of vO(i,t))s.has(a)||o.push(a)}}return r}var cO,lO,uO,dO,fO,pO,mO,hO,gO,bO,wO,yO,$O,n$,Kf=M(()=>{it();cO="rdfs:subClassOf",lO='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="10" r="3.4" fill="currentColor"/><circle cx="12" cy="15.6" r="4.6" fill="currentColor"/><g stroke="currentColor" stroke-width="1.1" fill="none" stroke-linecap="round"><path d="M9 8 L2 4"/><path d="M9 10 L1.5 9"/><path d="M9 12.5 L2 14"/><path d="M9 15.5 L3 19"/><path d="M15 8 L22 4"/><path d="M15 10 L22.5 9"/><path d="M15 12.5 L22 14"/><path d="M15 15.5 L21 19"/></g></svg>',uO='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="12" cy="13.2" rx="3.2" ry="5" fill="currentColor"/><circle cx="12" cy="7" r="2.6" fill="currentColor"/><g fill="currentColor" opacity="0.55"><path d="M9 10 C3 6 2 4 3 2 C6 2 9 6 10.5 10 Z"/><path d="M15 10 C21 6 22 4 21 2 C18 2 15 6 13.5 10 Z"/></g></svg>',dO='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2 C7 2 4 10 4 15.5 C4 20 7.6 22 12 22 C16.4 22 20 20 20 15.5 C20 10 17 2 12 2 Z" fill="currentColor"/></svg>',fO='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="13" cy="15" rx="6.4" ry="4.6" fill="currentColor"/><circle cx="7" cy="8.5" r="4" fill="currentColor"/><g fill="currentColor"><circle cx="4" cy="6" r="1.6"/><circle cx="7" cy="4.2" r="1.7"/><circle cx="10" cy="6" r="1.6"/></g><rect x="18.5" y="14" width="2.2" height="6" rx="1.1" fill="currentColor"/><circle cx="19.6" cy="13" r="1.5" fill="currentColor"/><g stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><line x1="9" y1="19.5" x2="9" y2="22"/><line x1="17" y1="19.5" x2="17" y2="22"/></g></svg>',pO='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="13" cy="15" rx="6.4" ry="4.2" fill="currentColor"/><circle cx="7" cy="9" r="3.6" fill="currentColor"/><path d="M4.5 6.5 L2 3 L6 5 Z" fill="currentColor"/><path d="M19 13 C22 12 22.5 15 20 16 Z" fill="currentColor"/><g stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><line x1="9" y1="19" x2="9" y2="22"/><line x1="17" y1="19" x2="17" y2="22"/></g></svg>',mO='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="12" cy="13" rx="7" ry="4.4" fill="currentColor"/><circle cx="12" cy="7" r="3.4" fill="currentColor"/><g stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><line x1="7" y1="17" x2="7" y2="21"/><line x1="17" y1="17" x2="17" y2="21"/></g></svg>',hO='<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="1" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M9 21 L9 13 A3 3 0 0 1 15 13 L15 21" fill="none" stroke="currentColor" stroke-width="1.6"/></svg>',gO='<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="4" y="5" width="16" height="3" rx="1" fill="currentColor"/><rect x="4" y="8" width="3" height="12" fill="currentColor"/><rect x="17" y="8" width="3" height="12" fill="currentColor"/></svg>',bO='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 6 C7.5 6 5 9.4 5 13.4 C5 17.7 8.1 20 12 20 C15.9 20 19 17.7 19 13.4 C19 9.4 16.5 6 12 6 Z" fill="currentColor"/><path d="M9.4 6.4 C9.9 4.6 10.8 3.4 12 3.4 C13.2 3.4 14.1 4.6 14.6 6.4" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/><ellipse cx="9.8" cy="11.6" rx="1.6" ry="2.1" fill="currentColor" opacity="0.28"/></svg>',wO='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="6.5" r="3.2" fill="currentColor"/><path d="M6 21 C6 15.5 8.7 13 12 13 C15.3 13 18 15.5 18 21 Z" fill="currentColor"/></svg>',yO='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="6.5" r="3.2" fill="currentColor"/><path d="M6 21 C6 15.5 8.7 13 12 13 C15.3 13 18 15.5 18 21 Z" fill="currentColor"/><rect x="15.5" y="13.5" width="4.5" height="5" rx="1" fill="currentColor" opacity="0.6"/></svg>',$O='<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="10" width="18" height="10" rx="1.2" fill="currentColor"/><path d="M3 10 L5 5 H19 L21 10 Z" fill="currentColor" opacity="0.7"/><rect x="10.6" y="9.4" width="2.8" height="2.2" rx="0.4" fill="currentColor" opacity="0.35"/></svg>',n$=Object.freeze({spider:lO,fly:uO,egg:dO,poodle:fO,dog:pO,animal:mO,room:hO,furniture:gO,portable:bO,person:wO,adventurer:yO,container:$O})});function xO(e){return[...new Set([...e.matchAll(/\bid="([^"]+)"/g)].map(t=>t[1]))]}function s$(e,t){if(!t||typeof e!="string")return e;let n=String(t).replace(/[^a-zA-Z0-9_-]/g,"-"),s=e;for(let o of xO(e)){let r=`${o}-${n}`;s=s.split(`id="${o}"`).join(`id="${r}"`),s=s.split(`url(#${o})`).join(`url(#${r})`)}return s}var o$=M(()=>{});function EO(e,t){return(t||[]).filter(n=>Array.isArray(n?.classes)&&n.classes.includes(e))}function SO(e){let t=e?.match;return t?Array.isArray(t)?t:[t]:[]}function c$(e){return SO(e).filter(t=>t?.property&&t.value!==void 0)}function jO(e,t){return e.length?e.every(n=>(t||[]).some(s=>s.predicate===n.property&&s.object===n.value)):!1}function kO(e,t){let n=null,s=0;for(let o of e){let r=c$(o);r.length<=s||jO(r,t)&&(n=o,s=r.length)}return n}function RO(e,t,n){if(typeof n=="string"&&t.placeholder)return e.split(t.placeholder).join(n);if(n&&typeof n=="object"&&t.placeholders){let s=e;for(let[o,r]of Object.entries(t.placeholders)){if(!Object.prototype.hasOwnProperty.call(n,o))return null;s=s.split(r).join(n[o])}return s}return null}function r$(e,t){let n=e.svg,s=0;for(let o of Object.values(e.parameters||{})){let r=o?.values||{},i=(t||[]).find(c=>c.predicate===o.property&&Object.prototype.hasOwnProperty.call(r,c.object));if(!i)continue;let a=RO(n,o,r[i.object]);a&&(n=a,s+=1)}return s>0?n:null}function _O(e){let t=[];for(let n of Object.values(e.parameters||{})){n?.placeholder&&t.push(n.placeholder);for(let s of Object.values(n?.placeholders||{}))t.push(s)}return t}function i$(e,t){let n=t;for(let s of _O(e))n=n.split(s).join("");return n}function a$(e,t,n){let s=EO(e,n),o=kO(s,t);if(o&&!o.parameters)return o.svg;if(o)return i$(o,r$(o,t)||o.svg);for(let a of s){if(a.match||!a.parameters)continue;let c=r$(a,t);if(c)return c}let r=s.find(a=>!a.match&&!a.parameters);if(r)return r.svg;let i=s.find(a=>!a.match&&a.parameters);return i?i$(i,i.svg):null}function TO(e,t,n,s,o,r){for(let a of Gc(e,t)){let c=a$(a,n,s);if(c)return c;if(Object.prototype.hasOwnProperty.call(o,a))return o[a]}let i=a$(r,n,s);return i||o[r]}function l$(e,t,n,s,o,{rootFallback:r="animal",instanceKey:i}={}){let a=TO(e,t,n,s,o,r);return i?s$(a,i):a}var t2,n2,Yf=M(()=>{Kf();o$();t2=Object.freeze(["left","half-left","half-right","right"]),n2=Object.freeze(["moving"])});function Wi(e){for(let t of e||[])if(t?.predicate===AO&&Object.prototype.hasOwnProperty.call(u$,t.object))return u$[t.object];return 1}var AO,u$,Xf=M(()=>{AO="mgx:hasProperty",u$=Object.freeze({small:.8,large:1.3,long:1.2,tall:1.25})});function d$(e,t){let n="mgx:feels",s="mgx:hasProperty",o=String(e&&e.class||"").trim(),r=String(e&&e.expression||"").trim(),i=String(e&&e.size||"").trim(),a=t||{},c=a.resolveSpriteAsset;if(typeof c!="function")throw new TypeError("resolveSpriteRequest needs deps.resolveSpriteAsset");let l=a.templates||[],u=a.spriteRegistry||{},d=a.factRows||[],p=a.rootFallback||"animal",f=a.classAncestorChain,m=a.sizeScaleFor,h=a.expressionPalette,g=[];r&&g.push({predicate:n,object:r}),i&&g.push({predicate:s,object:i});let b={rootFallback:p};a.instanceKey&&(b.instanceKey=a.instanceKey);let y=c(o,d,g,l,u,b),$=R=>c(R,[],g,l,{},{rootFallback:R}),E=R=>Object.prototype.hasOwnProperty.call(u,R),_=(R,w)=>{let T=l.filter(k=>k&&Array.isArray(k.classes)&&k.classes.indexOf(R)>=0),j=T.find(k=>k.svg===w)||T.find(k=>!k.match&&k.parameters)||null;return j?{classes:j.classes.slice(),parameters:Object.keys(j.parameters||{}).sort(),match:j.match||null}:null},v=null,S=null;if(typeof f=="function"){v=[];for(let R of f(o,d)){let w=$(R);if(v.push({term:R,template:!!w,registry:E(R)}),w){S={term:R,via:"template",hops:v.length-1,root:!1,template:_(R,w)};break}if(E(R)){S={term:R,via:"registry",hops:v.length-1,root:!1,template:null};break}}if(!S){let R=$(p);v.push({term:p,template:!!R,registry:E(p),root:!0}),S={term:p,via:R?"template":"registry",hops:v.length-1,root:!0,template:R?_(p,R):null}}}let C=a.instanceKey?c(o,d,g,l,u,{rootFallback:p}):y,x=r?c(o,d,g.filter(R=>R.predicate!==n),l,u,{rootFallback:p}):null;return{class:o,expression:r||null,size:i||null,svg:y,scale:typeof m=="function"?m(g):1,sizeKnown:i&&typeof m=="function"?m([{predicate:s,object:i}])!==1:null,expressionKnown:r&&h?Object.prototype.hasOwnProperty.call(h,r):null,expressionApplied:r?C!==x:null,rootFallback:p,fellBackToRoot:S?!!S.root:null,chain:v,matched:S}}var f$=M(()=>{});var p$,m$,CO,a2,h$=M(()=>{Yf();p$="icon tier",m$="sprite tier",CO=Object.freeze({takeParameter:Object.freeze({predicate:"mgx:take-parameter",comment:"sprite class -> parameter name: a parameter that class's own templates declare."}),offerVariant:Object.freeze({predicate:"mgx:offer-variant",comment:"sprite class -> variant value: a hand-authored [match] constraint that class's templates offer."})}),a2=Object.freeze(Object.values(CO).map(e=>e.predicate))});var g$,b$=M(()=>{g$=()=>[]});var w$,y$=M(()=>{w$=()=>[]});function LO(){let e=w$();return e.length?{templates:e,tier:m$}:{templates:g$(),tier:p$}}function $$(e){return e.map(t=>t.term).join(" -> ")}async function Jf(e,{config:t,memoryBackend:n=null}){let s=ft(e,"class").toLowerCase(),o=String(e?.expression||"").trim().toLowerCase(),r=String(e?.size||"").trim().toLowerCase();if(o&&!Object.hasOwn(Hs,o))throw new Oe(`"${o}" is not a sprite expression. The palette holds: ${OO().join(", ")}.`);if(r&&!NO(r))throw new Oe(`"${r}" is not a size the sprite scale recognises \u2014 it reads a taught mgx:hasProperty size word off the individual, and has no entry for this one.`);let{templates:i,tier:a}=LO(),c=await An(t,n),l=d$({class:s,expression:o,size:r},{factRows:c,templates:i,spriteRegistry:n$,resolveSpriteAsset:l$,classAncestorChain:Gc,sizeScaleFor:Wi,expressionPalette:Hs});if(!l.svg||l.fellBackToRoot)throw new Oe(`no sprite for "${s}" \u2014 neither it nor any rdfs:subClassOf ancestor the memory graph knows (${$$(l.chain)}) carries one in the ${a}. Teach the class its superclass first, or ask for a class the catalog draws.`);if(o&&!l.expressionApplied)throw new Oe(`the ${a} draws "${s}" (matched at "${l.matched.term}") but that template takes no expression, so "${o}" would not show. Ask for the plain sprite, or a class whose template carries an emotion parameter.`);let u=[o?`expression ${o}`:"",r?`size ${r}`:""].filter(Boolean),d=[`sprite for "${s}"${u.length?` (${u.join(", ")})`:""}, from the ${a}`,l.matched.hops===0?`matched at "${l.matched.term}", the class itself, via its own ${l.matched.via}`:`matched at "${l.matched.term}", ${l.matched.hops} hop(s) up the ancestor chain, via its ${l.matched.via}`,`ancestor chain walked: ${$$(l.chain)}`];return l.matched.template?.parameters.length&&d.push(`template parameters: ${l.matched.template.parameters.join(", ")}`),r&&d.push(`render scale: ${l.scale} (from the taught mgx:hasProperty "${r}")`),d.push(`${l.svg.length} characters of SVG markup`),to({content:d.join(`
157
- `),data:{class:l.class,expression:l.expression,size:l.size,tier:a,scale:l.scale,svg:l.svg,chain:l.chain,matched:l.matched,expressionApplied:l.expressionApplied}})}var IO,OO,NO,v$=M(()=>{Kt();Kf();Yf();$a();Xf();f$();h$();b$();y$();Uo();tt();IO="mgx:hasProperty",OO=()=>Object.keys(Hs).sort(),NO=e=>!!e&&Wi([{predicate:IO,object:String(e)}])!==1;Jf.ownsGraphLoad=!0});function x$(e,{graph:t}){return Jh(t,{pkg:String(e?.package||"").trim()})}var E$=M(()=>{De()});function S$(e,{graph:t,svc:n}){let{match:s}=Ft(n,ft(e,"module"),"module");return wg(t,s)}var j$=M(()=>{De();tt()});function k$(e,{graph:t,codeDomainActive:n=null}){return eg(t,{codeDomainActive:n})}var R$=M(()=>{De()});function T$(e,t){return to({content:e,data:t,text:`${e}${_$}${JSON.stringify(t,null,2)}`})}function A$(e,{graph:t}){let{content:n,tmct_ask:s}=Zs(t,ft(e,"query"));return T$(n,s)}var _$,Vc=M(()=>{Jn();tt();_$=`
155
+ ${h}`:""}${m}`}var qy=M(()=>{Pt();Kt();ec();De();tt()});var Ky,Yy=M(()=>{De();tt();Ky=gt(Qh)});function Xy(e,{graph:t,svc:n}){let{match:s}=Ft(n,ft(e,"module"),"module");return Uh(t,s)}var Jy=M(()=>{De();tt()});async function Qy(e,{graph:t,config:n}){let s=String(e?.query||"").trim(),o=String(e?.kind||"").trim();if(!s&&!o)throw new Ne("query is required");let r=Xh(t,s,{kind:o,decorator:String(e?.decorator||"").trim(),name:String(e?.name||"").trim(),toolNamePrefix:n?.toolNamePrefix});if(!o&&/^no module matches/.test(r)){let i=Gc(await In(n),s);if(i)return i}return r}var Zy=M(()=>{Kt();De();Bo()});async function e$(e,{graph:t,svc:n,config:s}){let o=ft(e,"class"),{match:r}=hn(n.graph,o);if(r)return Jh(t,r,{toolNamePrefix:s?.toolNamePrefix});let i=Wc(await In(s),o);if(i)return i;Ft(n,o,"class")}var t$=M(()=>{De();Bo();tt()});async function n$(e,{graph:t,svc:n,config:s}){let o=ft(e,"class"),{match:r}=hn(n.graph,o);if(r)return Zh(t,r);let i=Wc(await In(s),o);if(i)return i;Ft(n,o,"class")}var s$=M(()=>{De();Bo();tt()});function o$(e,{conceptBase:t="concept:",relationMap:n=wO}={}){let s=new Set(n.synonym||[]),o=new Set(n.related||[]),r=new Map,i=g=>{r.has(g)||r.set(g,g)},a=g=>{let b=g;for(;r.get(b)!==b;)b=r.get(b);for(;r.get(g)!==b;){let y=r.get(g);r.set(g,b),g=y}return b},c=(g,b)=>{let y=a(g),$=a(b);y!==$&&(y<$?r.set($,y):r.set(y,$))},l=[];for(let g of e){let b=g.predicate;if(!s.has(b)&&!o.has(b))continue;let y=q(g.subject),$=q(g.object);!y||!$||(i(y),i($),s.has(b)?c(y,$):l.push({s:y,o:$}))}let u=g=>t+g.replace(/ /g,"_"),d=new Map;for(let g of r.keys()){let b=a(g);d.has(b)||d.set(b,new Set),d.get(b).add(g)}let p=[];for(let[g,b]of d){let y=[...b].sort();p.push({id:u(g),prefLabel:g,altLabels:y.filter($=>$!==g)})}p.sort((g,b)=>g.id<b.id?-1:g.id>b.id?1:0);let f=new Set,m=[];for(let{s:g,o:b}of l){let y=u(a(g)),$=u(a(b));if(y===$)continue;let E=y<$?`${y}\0${$}`:`${$}\0${y}`;f.has(E)||(f.add(E),m.push({subject:y,object:$}))}return m.sort((g,b)=>`${g.subject}${g.object}`<`${b.subject}${b.object}`?-1:1),{concepts:p,related:m,conceptIdForTerm:g=>{let b=q(g);return r.has(b)?u(a(b)):null},namespace:bO}}function Yf(e,t,n={}){let s=o$(e,n),o=s.conceptIdForTerm(t);if(!o)return null;let r=new Map(s.concepts.map(u=>[u.id,u])),i=r.get(o),a=q(t),c=[i.prefLabel,...i.altLabels].filter(u=>u!==a),l=s.related.filter(u=>u.subject===o||u.object===o).map(u=>r.get(u.subject===o?u.object:u.subject)).filter(Boolean);return{conceptId:o,prefLabel:i.prefLabel,altLabels:i.altLabels,synonyms:c,related:l}}var bO,wO,Vc=M(()=>{it();bO="http://www.w3.org/2004/02/skos/core#",wO={synonym:["mgx:synonym"],related:["mgx:relatedTo","mgx:similarTo"]}});async function Xf(e,{config:t,memoryBackend:n=null}){let s=ft(e,"term"),o=Yf(await In(t,n),s);if(!o)throw new Ne(`no synonym or related facts for "${s}" in the memory graph. This view answers where the store holds mgx:synonym / mgx:relatedTo facts (a corpus import seeds them).`);let r=[`${o.prefLabel} [${o.conceptId}]`];return o.synonyms.length&&r.push(`synonyms (skos:altLabel): ${o.synonyms.join(", ")}`),o.related.length&&r.push(`related (skos:related): ${o.related.map(i=>i.prefLabel).join(", ")}`),r.push("(from the memory graph's mgx:synonym / mgx:relatedTo / mgx:similarTo facts)"),no({content:r.join(`
156
+ `),data:o})}var r$=M(()=>{Kt();Vc();Bo();tt();Xf.ownsGraphLoad=!0});function IO(e,t){let n=[];for(let s of t||[])s?.predicate===yO&&q(s.subject)===e&&n.push(q(s.object));return n}function Hc(e,t){let n=q(e),s=new Set,o=[n],r=[];for(;o.length;){let i=o.shift();if(!s.has(i)){s.add(i),r.push(i);for(let a of IO(i,t))s.has(a)||o.push(a)}}return r}var yO,$O,vO,xO,EO,SO,jO,kO,RO,_O,TO,AO,CO,i$,Jf=M(()=>{it();yO="rdfs:subClassOf",$O='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="10" r="3.4" fill="currentColor"/><circle cx="12" cy="15.6" r="4.6" fill="currentColor"/><g stroke="currentColor" stroke-width="1.1" fill="none" stroke-linecap="round"><path d="M9 8 L2 4"/><path d="M9 10 L1.5 9"/><path d="M9 12.5 L2 14"/><path d="M9 15.5 L3 19"/><path d="M15 8 L22 4"/><path d="M15 10 L22.5 9"/><path d="M15 12.5 L22 14"/><path d="M15 15.5 L21 19"/></g></svg>',vO='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="12" cy="13.2" rx="3.2" ry="5" fill="currentColor"/><circle cx="12" cy="7" r="2.6" fill="currentColor"/><g fill="currentColor" opacity="0.55"><path d="M9 10 C3 6 2 4 3 2 C6 2 9 6 10.5 10 Z"/><path d="M15 10 C21 6 22 4 21 2 C18 2 15 6 13.5 10 Z"/></g></svg>',xO='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2 C7 2 4 10 4 15.5 C4 20 7.6 22 12 22 C16.4 22 20 20 20 15.5 C20 10 17 2 12 2 Z" fill="currentColor"/></svg>',EO='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="13" cy="15" rx="6.4" ry="4.6" fill="currentColor"/><circle cx="7" cy="8.5" r="4" fill="currentColor"/><g fill="currentColor"><circle cx="4" cy="6" r="1.6"/><circle cx="7" cy="4.2" r="1.7"/><circle cx="10" cy="6" r="1.6"/></g><rect x="18.5" y="14" width="2.2" height="6" rx="1.1" fill="currentColor"/><circle cx="19.6" cy="13" r="1.5" fill="currentColor"/><g stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><line x1="9" y1="19.5" x2="9" y2="22"/><line x1="17" y1="19.5" x2="17" y2="22"/></g></svg>',SO='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="13" cy="15" rx="6.4" ry="4.2" fill="currentColor"/><circle cx="7" cy="9" r="3.6" fill="currentColor"/><path d="M4.5 6.5 L2 3 L6 5 Z" fill="currentColor"/><path d="M19 13 C22 12 22.5 15 20 16 Z" fill="currentColor"/><g stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><line x1="9" y1="19" x2="9" y2="22"/><line x1="17" y1="19" x2="17" y2="22"/></g></svg>',jO='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="12" cy="13" rx="7" ry="4.4" fill="currentColor"/><circle cx="12" cy="7" r="3.4" fill="currentColor"/><g stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><line x1="7" y1="17" x2="7" y2="21"/><line x1="17" y1="17" x2="17" y2="21"/></g></svg>',kO='<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="1" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M9 21 L9 13 A3 3 0 0 1 15 13 L15 21" fill="none" stroke="currentColor" stroke-width="1.6"/></svg>',RO='<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="4" y="5" width="16" height="3" rx="1" fill="currentColor"/><rect x="4" y="8" width="3" height="12" fill="currentColor"/><rect x="17" y="8" width="3" height="12" fill="currentColor"/></svg>',_O='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 6 C7.5 6 5 9.4 5 13.4 C5 17.7 8.1 20 12 20 C15.9 20 19 17.7 19 13.4 C19 9.4 16.5 6 12 6 Z" fill="currentColor"/><path d="M9.4 6.4 C9.9 4.6 10.8 3.4 12 3.4 C13.2 3.4 14.1 4.6 14.6 6.4" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/><ellipse cx="9.8" cy="11.6" rx="1.6" ry="2.1" fill="currentColor" opacity="0.28"/></svg>',TO='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="6.5" r="3.2" fill="currentColor"/><path d="M6 21 C6 15.5 8.7 13 12 13 C15.3 13 18 15.5 18 21 Z" fill="currentColor"/></svg>',AO='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="6.5" r="3.2" fill="currentColor"/><path d="M6 21 C6 15.5 8.7 13 12 13 C15.3 13 18 15.5 18 21 Z" fill="currentColor"/><rect x="15.5" y="13.5" width="4.5" height="5" rx="1" fill="currentColor" opacity="0.6"/></svg>',CO='<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="10" width="18" height="10" rx="1.2" fill="currentColor"/><path d="M3 10 L5 5 H19 L21 10 Z" fill="currentColor" opacity="0.7"/><rect x="10.6" y="9.4" width="2.8" height="2.2" rx="0.4" fill="currentColor" opacity="0.35"/></svg>',i$=Object.freeze({spider:$O,fly:vO,egg:xO,poodle:EO,dog:SO,animal:jO,room:kO,furniture:RO,portable:_O,person:TO,adventurer:AO,container:CO})});function OO(e){return[...new Set([...e.matchAll(/\bid="([^"]+)"/g)].map(t=>t[1]))]}function a$(e,t){if(!t||typeof e!="string")return e;let n=String(t).replace(/[^a-zA-Z0-9_-]/g,"-"),s=e;for(let o of OO(e)){let r=`${o}-${n}`;s=s.split(`id="${o}"`).join(`id="${r}"`),s=s.split(`url(#${o})`).join(`url(#${r})`)}return s}var c$=M(()=>{});function NO(e,t){return(t||[]).filter(n=>Array.isArray(n?.classes)&&n.classes.includes(e))}function LO(e){let t=e?.match;return t?Array.isArray(t)?t:[t]:[]}function f$(e){return LO(e).filter(t=>t?.property&&t.value!==void 0)}function PO(e,t){return e.length?e.every(n=>(t||[]).some(s=>s.predicate===n.property&&s.object===n.value)):!1}function MO(e,t){let n=null,s=0;for(let o of e){let r=f$(o);r.length<=s||PO(r,t)&&(n=o,s=r.length)}return n}function FO(e,t,n){if(typeof n=="string"&&t.placeholder)return e.split(t.placeholder).join(n);if(n&&typeof n=="object"&&t.placeholders){let s=e;for(let[o,r]of Object.entries(t.placeholders)){if(!Object.prototype.hasOwnProperty.call(n,o))return null;s=s.split(r).join(n[o])}return s}return null}function l$(e,t){let n=e.svg,s=0;for(let o of Object.values(e.parameters||{})){let r=o?.values||{},i=(t||[]).find(c=>c.predicate===o.property&&Object.prototype.hasOwnProperty.call(r,c.object));if(!i)continue;let a=FO(n,o,r[i.object]);a&&(n=a,s+=1)}return s>0?n:null}function DO(e){let t=[];for(let n of Object.values(e.parameters||{})){n?.placeholder&&t.push(n.placeholder);for(let s of Object.values(n?.placeholders||{}))t.push(s)}return t}function u$(e,t){let n=t;for(let s of DO(e))n=n.split(s).join("");return n}function d$(e,t,n){let s=NO(e,n),o=MO(s,t);if(o&&!o.parameters)return o.svg;if(o)return u$(o,l$(o,t)||o.svg);for(let a of s){if(a.match||!a.parameters)continue;let c=l$(a,t);if(c)return c}let r=s.find(a=>!a.match&&!a.parameters);if(r)return r.svg;let i=s.find(a=>!a.match&&a.parameters);return i?u$(i,i.svg):null}function zO(e,t,n,s,o,r){for(let a of Hc(e,t)){let c=d$(a,n,s);if(c)return c;if(Object.prototype.hasOwnProperty.call(o,a))return o[a]}let i=d$(r,n,s);return i||o[r]}function p$(e,t,n,s,o,{rootFallback:r="animal",instanceKey:i}={}){let a=zO(e,t,n,s,o,r);return i?a$(a,i):a}var f2,p2,Qf=M(()=>{Jf();c$();f2=Object.freeze(["left","half-left","half-right","right"]),p2=Object.freeze(["moving"])});function Hi(e){for(let t of e||[])if(t?.predicate===UO&&Object.prototype.hasOwnProperty.call(m$,t.object))return m$[t.object];return 1}var UO,m$,Zf=M(()=>{UO="mgx:hasProperty",m$=Object.freeze({small:.8,large:1.3,long:1.2,tall:1.25})});function h$(e,t){let n="mgx:feels",s="mgx:hasProperty",o=String(e&&e.class||"").trim(),r=String(e&&e.expression||"").trim(),i=String(e&&e.size||"").trim(),a=t||{},c=a.resolveSpriteAsset;if(typeof c!="function")throw new TypeError("resolveSpriteRequest needs deps.resolveSpriteAsset");let l=a.templates||[],u=a.spriteRegistry||{},d=a.factRows||[],p=a.rootFallback||"animal",f=a.classAncestorChain,m=a.sizeScaleFor,h=a.expressionPalette,g=[];r&&g.push({predicate:n,object:r}),i&&g.push({predicate:s,object:i});let b={rootFallback:p};a.instanceKey&&(b.instanceKey=a.instanceKey);let y=c(o,d,g,l,u,b),$=R=>c(R,[],g,l,{},{rootFallback:R}),E=R=>Object.prototype.hasOwnProperty.call(u,R),_=(R,w)=>{let T=l.filter(k=>k&&Array.isArray(k.classes)&&k.classes.indexOf(R)>=0),j=T.find(k=>k.svg===w)||T.find(k=>!k.match&&k.parameters)||null;return j?{classes:j.classes.slice(),parameters:Object.keys(j.parameters||{}).sort(),match:j.match||null}:null},v=null,S=null;if(typeof f=="function"){v=[];for(let R of f(o,d)){let w=$(R);if(v.push({term:R,template:!!w,registry:E(R)}),w){S={term:R,via:"template",hops:v.length-1,root:!1,template:_(R,w)};break}if(E(R)){S={term:R,via:"registry",hops:v.length-1,root:!1,template:null};break}}if(!S){let R=$(p);v.push({term:p,template:!!R,registry:E(p),root:!0}),S={term:p,via:R?"template":"registry",hops:v.length-1,root:!0,template:R?_(p,R):null}}}let C=a.instanceKey?c(o,d,g,l,u,{rootFallback:p}):y,x=r?c(o,d,g.filter(R=>R.predicate!==n),l,u,{rootFallback:p}):null;return{class:o,expression:r||null,size:i||null,svg:y,scale:typeof m=="function"?m(g):1,sizeKnown:i&&typeof m=="function"?m([{predicate:s,object:i}])!==1:null,expressionKnown:r&&h?Object.prototype.hasOwnProperty.call(h,r):null,expressionApplied:r?C!==x:null,rootFallback:p,fellBackToRoot:S?!!S.root:null,chain:v,matched:S}}var g$=M(()=>{});var b$,w$,BO,w2,y$=M(()=>{Qf();b$="icon tier",w$="sprite tier",BO=Object.freeze({takeParameter:Object.freeze({predicate:"mgx:take-parameter",comment:"sprite class -> parameter name: a parameter that class's own templates declare."}),offerVariant:Object.freeze({predicate:"mgx:offer-variant",comment:"sprite class -> variant value: a hand-authored [match] constraint that class's templates offer."})}),w2=Object.freeze(Object.values(BO).map(e=>e.predicate))});var $$,v$=M(()=>{$$=()=>[]});var x$,E$=M(()=>{x$=()=>[]});function HO(){let e=x$();return e.length?{templates:e,tier:w$}:{templates:$$(),tier:b$}}function S$(e){return e.map(t=>t.term).join(" -> ")}async function ep(e,{config:t,memoryBackend:n=null}){let s=ft(e,"class").toLowerCase(),o=String(e?.expression||"").trim().toLowerCase(),r=String(e?.size||"").trim().toLowerCase();if(o&&!Object.hasOwn(Hs,o))throw new Ne(`"${o}" is not a sprite expression. The palette holds: ${GO().join(", ")}.`);if(r&&!VO(r))throw new Ne(`"${r}" is not a size the sprite scale recognises \u2014 it reads a taught mgx:hasProperty size word off the individual, and has no entry for this one.`);let{templates:i,tier:a}=HO(),c=await In(t,n),l=h$({class:s,expression:o,size:r},{factRows:c,templates:i,spriteRegistry:i$,resolveSpriteAsset:p$,classAncestorChain:Hc,sizeScaleFor:Hi,expressionPalette:Hs});if(!l.svg||l.fellBackToRoot)throw new Ne(`no sprite for "${s}" \u2014 neither it nor any rdfs:subClassOf ancestor the memory graph knows (${S$(l.chain)}) carries one in the ${a}. Teach the class its superclass first, or ask for a class the catalog draws.`);if(o&&!l.expressionApplied)throw new Ne(`the ${a} draws "${s}" (matched at "${l.matched.term}") but that template takes no expression, so "${o}" would not show. Ask for the plain sprite, or a class whose template carries an emotion parameter.`);let u=[o?`expression ${o}`:"",r?`size ${r}`:""].filter(Boolean),d=[`sprite for "${s}"${u.length?` (${u.join(", ")})`:""}, from the ${a}`,l.matched.hops===0?`matched at "${l.matched.term}", the class itself, via its own ${l.matched.via}`:`matched at "${l.matched.term}", ${l.matched.hops} hop(s) up the ancestor chain, via its ${l.matched.via}`,`ancestor chain walked: ${S$(l.chain)}`];return l.matched.template?.parameters.length&&d.push(`template parameters: ${l.matched.template.parameters.join(", ")}`),r&&d.push(`render scale: ${l.scale} (from the taught mgx:hasProperty "${r}")`),d.push(`${l.svg.length} characters of SVG markup`),no({content:d.join(`
157
+ `),data:{class:l.class,expression:l.expression,size:l.size,tier:a,scale:l.scale,svg:l.svg,chain:l.chain,matched:l.matched,expressionApplied:l.expressionApplied}})}var WO,GO,VO,j$=M(()=>{Kt();Jf();Qf();Ea();Zf();g$();y$();v$();E$();Bo();tt();WO="mgx:hasProperty",GO=()=>Object.keys(Hs).sort(),VO=e=>!!e&&Hi([{predicate:WO,object:String(e)}])!==1;ep.ownsGraphLoad=!0});function k$(e,{graph:t}){return eg(t,{pkg:String(e?.package||"").trim()})}var R$=M(()=>{De()});function _$(e,{graph:t,svc:n}){let{match:s}=Ft(n,ft(e,"module"),"module");return vg(t,s)}var T$=M(()=>{De();tt()});function A$(e,{graph:t,codeDomainActive:n=null}){return sg(t,{codeDomainActive:n})}var C$=M(()=>{De()});function O$(e,t){return no({content:e,data:t,text:`${e}${I$}${JSON.stringify(t,null,2)}`})}function N$(e,{graph:t}){let{content:n,tmct_ask:s}=eo(t,ft(e,"query"));return O$(n,s)}var I$,qc=M(()=>{Jn();tt();I$=`
158
158
 
159
159
  ---tmct_ask---
160
- `});var C$,I$=M(()=>{De();tt();C$=gt(Zh)});var O$,N$=M(()=>{De();tt();O$=gt(tg)});var L$,P$=M(()=>{De();tt();L$=gt(cg)});var M$,F$=M(()=>{De();tt();M$=gt(ug)});var D$,z$=M(()=>{De();tt();D$=gt(dg)});var U$,B$=M(()=>{De();tt();U$=gt(sg)});var W$,G$=M(()=>{De();tt();W$=gt(og)});var V$,H$=M(()=>{De();tt();V$=gt(ig)});var q$,K$=M(()=>{De();tt();q$=gt(bg)});function PO(e){let t={subject:e.subject,predicate:e.predicate,object:e.object,provenance:e.provenance||""};return e.quantifier&&(t.quantifier=e.quantifier),t}function MO(e){let t=(e||[]).map(PO);return t.map(n=>JSON.stringify(n)).join(`
160
+ `});var L$,P$=M(()=>{De();tt();L$=gt(ng)});var M$,F$=M(()=>{De();tt();M$=gt(og)});var D$,z$=M(()=>{De();tt();D$=gt(dg)});var U$,B$=M(()=>{De();tt();U$=gt(pg)});var W$,G$=M(()=>{De();tt();W$=gt(mg)});var V$,H$=M(()=>{De();tt();V$=gt(ig)});var q$,K$=M(()=>{De();tt();q$=gt(ag)});var Y$,X$=M(()=>{De();tt();Y$=gt(lg)});var J$,Q$=M(()=>{De();tt();J$=gt($g)});function qO(e){let t={subject:e.subject,predicate:e.predicate,object:e.object,provenance:e.provenance||""};return e.quantifier&&(t.quantifier=e.quantifier),t}function KO(e){let t=(e||[]).map(qO);return t.map(n=>JSON.stringify(n)).join(`
161
161
  `)+(t.length?`
162
- `:"")}function Y$(e){return MO(bt(e))}var X$=M(()=>{qe()});async function Qf(e,{config:t,memoryBackend:n=null}){let s=n?null:await io(ye(ye(t.graphFile))),o=n||s.dir;try{return Y$(await pt(o))||"(the memory store holds no facts to export)"}finally{s&&await s.close()}}var J$=M(()=>{X$();Je();qe();Qf.ownsGraphLoad=!0});async function Zf(e,{config:t,ingest:n}){let s=String(e?.text??"");if(!s.trim())return"(nothing to ingest \u2014 pass some text)";if(typeof n!="function")return"(ingest isn't wired into this context \u2014 invoke tmct_ingest through the CLI `cli` route or the chat surface)";let o=e?.optimistic===!0,{dir:r,close:i}=await io(ye(ye(t.graphFile)));try{let a=await n(s,{memoryDir:r,config:t,sourceTag:"tool",optimistic:o,canonical:!0}),c=a.extracted.length+a.optimistic.length,l=`${a.sentences} sentence(s), ${a.recognized} recognized`+(o?`, ${a.optimistic.length} optimistic candidate(s)`:"")+`, ${a.skipped} skipped \u2014 ${c} fact(s) grounded.`;return to({content:c?`${l}
162
+ `:"")}function Z$(e){return KO(bt(e))}var ev=M(()=>{qe()});async function tp(e,{config:t,memoryBackend:n=null}){let s=n?null:await ao(ye(ye(t.graphFile))),o=n||s.dir;try{return Z$(await pt(o))||"(the memory store holds no facts to export)"}finally{s&&await s.close()}}var tv=M(()=>{ev();Je();qe();tp.ownsGraphLoad=!0});async function np(e,{config:t,ingest:n}){let s=String(e?.text??"");if(!s.trim())return"(nothing to ingest \u2014 pass some text)";if(typeof n!="function")return"(ingest isn't wired into this context \u2014 invoke tmct_ingest through the CLI `cli` route or the chat surface)";let o=e?.optimistic===!0,{dir:r,close:i}=await ao(ye(ye(t.graphFile)));try{let a=await n(s,{memoryDir:r,config:t,sourceTag:"tool",optimistic:o,canonical:!0}),c=a.extracted.length+a.optimistic.length,l=`${a.sentences} sentence(s), ${a.recognized} recognized`+(o?`, ${a.optimistic.length} optimistic candidate(s)`:"")+`, ${a.skipped} skipped \u2014 ${c} fact(s) grounded.`;return no({content:c?`${l}
163
163
  ${a.canonical.join(`
164
- `)}`:l,data:{...a,grounded:c}})}finally{await i()}}var Q$=M(()=>{Je();qe();tt();Zf.ownsGraphLoad=!0});var FO,Z$=M(()=>{Sd();Qb();Uy();Wy();Vy();qy();Yy();Jy();Zy();t$();v$();E$();j$();R$();Vc();I$();N$();P$();F$();z$();B$();G$();H$();K$();J$();Q$();FO=Object.freeze({tmct_context:Ed,tmct_context_more:Jb,tmct_describe:zy,tmct_snippet:By,tmct_signature:Gy,tmct_impact:Hy,tmct_search:Ky,tmct_members:Xy,tmct_subclasses:Qy,tmct_related:qf,tmct_sprite:Jf,tmct_architecture:x$,tmct_exports:S$,tmct_untested:k$,tmct_ask:A$,tmct_tests_for:C$,tmct_history:O$,tmct_file_history:L$,tmct_method_history:M$,tmct_class_history:D$,tmct_callers:U$,tmct_callees:W$,tmct_calls:V$,tmct_cochanges:q$,tmct_export:Qf,tmct_ingest:Zf})});var ep=M(()=>{});var Hc,tp=M(()=>{Hc=()=>({relations:[],constructions:[]})});var ev,tv=M(()=>{Lt();Je();sh();Kt();ni();Jn();tc();nc();Z$();Vc();tt();hr();Ba();ep();tp();nc();Sd();Vc();Wa(void 0);Ua(Hc);ev=nh.map(({name:e,agentDescription:t,inputSchema:n})=>({name:e,description:t,inputSchema:n}))});var Fs,sp=M(()=>{Fs=Object.freeze({"rdfs:subClassOf":"is a kind of","mgxneg:subClassOf":"is not a kind of","rdf:type":"is a","owl:disjointWith":"is not a","owl:unionOf":"is either","owl:complementOf":"is anything that is not","owl:oneOf":"includes exactly","owl:differentFrom":"is not the same as","mgx:partOf":"is part of","mgx:memberOf":"is a member of","mgx:collectionOf":"is a collection of","mgx:hasA":"has","mgx:usedFor":"is used for","mgx:capableOf":"can","mgx:atLocation":"is found in","mgx:causes":"causes","mgx:hasProperty":"is","mgx:madeOf":"is made of","mgx:receivesAction":"can be","mgx:createdBy":"is created by","mgx:mannerOf":"is a way to","mgx:desires":"wants","mgx:locatedNear":"is typically near","mgx:motivatedByGoal":"is motivated by","mgx:obstructedBy":"can be prevented by","mgx:causesDesire":"makes you want to","mgx:hasSubevent":"involves","mgx:hasFirstSubevent":"begins with","mgx:hasLastSubevent":"ends with","mgx:hasPrerequisite":"requires","mgx:ownedBy":"is owned by","mgx:rendersAs":"renders as","mgx:synonym":"means the same as","mgx:antonym":"is the opposite of","mgx:similarTo":"is similar to","mgx:relatedTo":"is related to","mgx:symbolOf":"is a symbol of","mgx:currently-in":"is in","mgx:located-in":"is in","mgx:fixed-in":"is fixed in","mgx:stands-locked-in":"stands locked in","mgx:works-in":"works in","mgx:pursues":"pursues","mgx:evades":"evades","mgx:consumes":"eats","mgx:vision-radius":"sees within","mgx:guards":"guards"})});var dG,fG,pG,qc=M(()=>{dG=Object.freeze(["entity","set","event","measure"]),fG=Object.freeze(["date","count","op","pivot","metric","kind","provenance"]),pG=Object.freeze({it:Object.freeze(["entity","event","measure"]),this:Object.freeze(["entity","event","measure"]),that:Object.freeze(["entity","event","measure"]),"this one":Object.freeze(["entity","event","measure"]),"that one":Object.freeze(["entity","event","measure"]),those:Object.freeze(["set"]),them:Object.freeze(["set"]),these:Object.freeze(["set"]),here:Object.freeze(["entity"])})});var Kc=M(()=>{});var St,gG,bG,wG,yG,$G,vG,xG,EG,SG,jG,kG,RG,_G,TG,AG,CG,qt,IG,OG,NG,ao=M(()=>{St=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},gG=St("createRequire"),bG=St("readFileSync"),wG=St("access"),yG=St("readFile"),$G=St("writeFile"),vG=St("appendFile"),xG=St("mkdir"),EG=St("mkdtemp"),SG=St("rename"),jG=St("unlink"),kG=St("rm"),RG=St("stat"),_G=St("copyFile"),TG=St("readdir"),AG=St("createReadStream"),CG=St("createWriteStream"),qt=e=>String(e),IG=St("randomBytes"),OG=St("spawnSync"),NG=St("createInterface")});var lv={};Nt(lv,{PHRASEBOOK_FILE:()=>ov,TECHNICAL_SLOTS:()=>op,TEMPLATES_FILE:()=>sv,flatten:()=>ip,loadPhrasebook:()=>BO,loadTemplates:()=>ap,loadTemplatesMerged:()=>UO,render:()=>cv,renderSegments:()=>av,slotKind:()=>iv,slotsOf:()=>rp});function rp(e){let t=[];for(let n of String(e).matchAll(rv))t.includes(n[1])||t.push(n[1]);return t}function iv(e){return zO[e]||"entity"}function ip(e){let t="";for(let n of e)t+=n.text;return t}function av(e,t={},n=Gi){if(!n)throw new Error("renderSegments() before loadTemplates() \u2014 load the template library first");let s=n.get(e);if(!s)throw new Error(`unknown template id "${e}"`);let o=s.slots.filter(u=>t[u]===void 0||t[u]===null);if(o.length)throw new Error(`template "${e}" missing slot${o.length>1?"s":""}: ${o.join(", ")}`);let r=s.template,i=new RegExp(rv.source,"g"),a=[],c=0,l;for(;(l=i.exec(r))!==null;)l.index>c&&a.push({type:"prose",text:r.slice(c,l.index)}),a.push({type:iv(l[1]),text:String(t[l[1]])}),c=l.index+l[0].length;return c<r.length&&a.push({type:"prose",text:r.slice(c)}),a}async function ap(e=sv){let t=await Ce(e,"utf8"),n=new Map,s=t.split(`
165
- `);for(let o=0;o<s.length;o+=1){let r=s[o].trim();if(!r)continue;let i;try{i=JSON.parse(r)}catch(c){throw new Error(`${e}:${o+1}: not valid JSON: ${c.message}`)}for(let c of["id","class","template","register"])if(typeof i[c]!="string"||!i[c])throw new Error(`${e}:${o+1}: missing/empty "${c}"`);if(!DO.has(i.register))throw new Error(`${e}:${o+1}: register must be terse|friendly|technical, got "${i.register}"`);if(n.has(i.id))throw new Error(`${e}:${o+1}: duplicate template id "${i.id}"`);let a=rp(i.template);if(i.register==="technical"){let c=a.filter(l=>!op.has(l));if(c.length)throw new Error(`${e}:${o+1}: technical template "${i.id}" uses non-mechanical slot${c.length>1?"s":""}: ${c.join(", ")} (allowed: ${[...op].join(", ")})`);if(!a.includes("provenance"))throw new Error(`${e}:${o+1}: technical template "${i.id}" must carry a {provenance} fill (an advanced claim always shows its source)`)}n.set(i.id,{...i,slots:a})}return Gi=n,n}async function UO(e=[]){let t=Gi,n=new Map;try{for(let s of e){let o=await ap(s);for(let[r,i]of o){if(!r.includes(":"))throw new Error(`${s}: extension-pack template id "${r}" is not namespaced ("<packname>:<id>")`);if(n.has(r))throw new Error(`${s}: duplicate template id "${r}" already loaded from an earlier path`);n.set(r,i)}}}finally{Gi=t}return n}function cv(e,t={},n=Gi){if(!n)throw new Error("render() before loadTemplates() \u2014 load the template library first");return ip(av(e,t,n))}async function BO(e=ov){let t=await Ce(e,"utf8"),n=[],s=[],o=t.split(`
166
- `);for(let r=0;r<o.length;r+=1){let i=o[r].trim();if(!(!i||i.startsWith("#"))){if(i.startsWith("~")){let a=i.slice(1).split(",").map(c=>c.trim().toLowerCase()).filter(Boolean);if(a.length<2)throw new Error(`${e}:${r+1}: a synonym family needs at least 2 entries`);s.push(a);continue}n.push({pattern:i,slots:rp(i)})}}return{patterns:n,synonyms:s}}var WO,nv,sv,ov,DO,rv,op,zO,Gi,Yc=M(()=>{Lt();ao();Je();WO={},nv=ne(ye(qt(WO.url)),"..","..",".."),sv=ne(nv,"data","templates","responses.jsonl"),ov=ne(nv,"data","phrasebook","software-phrases.txt"),DO=new Set(["terse","friendly","technical"]),rv=/\{([A-Za-z][A-Za-z0-9]*)\}/g,op=Object.freeze(new Set(["subject","count","noun","scope","comparison","metric","unit","superlative","provenance"]));zO={count:"number",when:"number",location:"path",commit:"path",provenance:"provenance"};Gi=null});function VO(e,t={}){let n=GO.exec(String(e||""));if(!n)return 1;let s=t?.[n[1]];return typeof s=="number"&&Number.isFinite(s)?s:1}function HO(e,t={}){let n=Array.isArray(e?.sourceIds)?e.sourceIds:[];return n.length?Math.max(...n.map(s=>VO(s,t))):1}function at(e,t={}){return(Array.isArray(e)?e:[]).map((s,o)=>({row:s,index:o,bias:HO(s,t)})).sort((s,o)=>o.bias-s.bias||(o.row?.trust??0)-(s.row?.trust??0)||s.index-o.index).map(s=>s.row)}var GO,uv=M(()=>{GO=/^src:corpus:(.+)$/});var jt,zG,Fr,UG,BG,WG,GG,VG,HG,qG,KG,YG,XG,JG,QG,dv,qO,ZG,eV,tV,Bo=M(()=>{jt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},zG=jt("createRequire"),Fr=jt("readFileSync"),UG=jt("access"),BG=jt("readFile"),WG=jt("writeFile"),GG=jt("appendFile"),VG=jt("mkdir"),HG=jt("mkdtemp"),qG=jt("rename"),KG=jt("unlink"),YG=jt("rm"),XG=jt("stat"),JG=jt("copyFile"),QG=jt("readdir"),dv=jt("createReadStream"),qO=jt("createWriteStream"),ZG=jt("randomBytes"),eV=jt("spawnSync"),tV=jt("createInterface")});function cp(e,t){let n=String(e).toLowerCase().replace(/^[^a-z]+/,"");if(!n)return null;for(let o of t.vowel_sound_consonants||[])if(n.startsWith(o))return!0;for(let o of t.consonant_sound_vowels||[])if(n.startsWith(o))return!1;let s=n[0];return"aeiou".includes(s)?!0:/[a-z]/.test(s)?!1:null}function JO(e=YO){let t=Mo(Fr(e,"utf8"));return Array.isArray(t.rule)?t.rule:[]}function Jc(){if(Xc===null)try{Xc=JO()}catch{Xc=[]}return Xc}var QO,KO,YO,XO,cV,Xc,Qc=M(()=>{Bo();ao();Je();Rc();Yc();QO={},KO=ye(qt(QO.url)),YO=ne(KO,"..","..","data","templates","grammar-rules.toml"),XO=Object.freeze(["prose","entity","path","number","code","provenance","receipt"]),cV=Object.freeze(new Set(XO.filter(e=>e!=="prose")));Xc=null});function ZO(){if(Vi!==void 0)return Vi;try{let e=fv?fv():eN();Vi=e&&e.winkNLP&&e.model?e:null}catch{Vi=null}return Vi}function eN(){let e=process.getBuiltinModule("node:module").createRequire(tN.url);return{winkNLP:e("wink-nlp"),model:e("wink-eng-lite-web-model")}}function Zc(){if(Dr!==void 0)return Dr;let e=ZO();if(!e)return Dr=null,null;try{Dr=e.winkNLP(e.model)}catch{Dr=null}return Dr}var tN,fv,Vi,Dr,el=M(()=>{tN={}});var lp=M(()=>{el()});var mv,pv=M(()=>{mv={comment:"tmct's starter lexicon, now covering BOTH the original software domain and the default 'human-world' persona's everyday people/places/objects/nature/time/body/mind vocabulary. Every word the ACE-OWL sub-fragment parser (src/domain/grammar/ace.mjs) is allowed to understand is DECLARED here \u2014 tmct never guesses a word's category. Nouns may declare a possessive property typing ('data' or 'object', pattern 7) or an irregular 'plural' (WordNet-sourced human nouns like 'man'/'child' need this \u2014 the morphology fold only handles regular -s/-ies/-es endings); adjectives MUST declare a type ('subclass' forms a class, 'data' asserts a boolean-ish datatype property, pattern 8); verbs may declare a preposition ('depend' + 'on' \u2192 dependsOn). The human-domain additions are flat and simple (breadth over depth \u2014 no gender/kinship taxonomy, no formal role hierarchy), matching corpus/tier2/generate.mjs's CORPUSES.human.lexicon sub-key, which --verify drift-checks against. Extend via loadLexicon(extra) with this same shape.",nouns:{module:{},class:{},function:{},method:{},attribute:{},variable:{},constant:{},test:{},suite:{},service:{},repository:{},branch:{},commit:{},tag:{},release:{},package:{},library:{},framework:{},api:{},endpoint:{},route:{},handler:{},controller:{},model:{},view:{},template:{},component:{},interface:{},type:{},category:{},kind:{},artifact:{},routine:{},part:{},helper:{},operation:{},change:{},schema:{},database:{},table:{},query:{},index:{plural:"indices"},cache:{},queue:{},worker:{},job:{},task:{},bug:{},defect:{},issue:{},ticket:{},feature:{},requirement:{},specification:{},document:{},developer:{},engineer:{},user:{},visitor:{},team:{},project:{},codebase:{},file:{},directory:{},folder:{},line:{},symbol:{},identifier:{},comment:{},docstring:{},string:{},number:{},list:{},array:{},graph:{},node:{},edge:{},triple:{},fact:{},ontology:{},lexicon:{},grammar:{},sentence:{},utterance:{},session:{},response:{},request:{},question:{},answer:{},error:{},exception:{},warning:{},log:{},metric:{},benchmark:{},pipeline:{},build:{},deployment:{},environment:{},config:{},configuration:{},setting:{},option:{},flag:{},argument:{},parameter:{},value:{},result:{},output:{},input:{},server:{},client:{},protocol:{},message:{},event:{},hook:{},plugin:{},script:{},tool:{},command:{},prompt:{},token:{},parser:{},compiler:{},linter:{},formatter:{},runtime:{},process:{},thread:{},loop:{},statement:{},expression:{},keyword:{},scope:{},callback:{},promise:{},iterator:{},generator:{},unit:{},risk:{},prototype:{},milestone:{},sprint:{},backlog:{},roadmap:{},phase:{},pattern:{},smell:{},coverage:{},mock:{},stub:{},fixture:{},assertion:{},snapshot:{},regression:{},migration:{},refactor:{},review:{},merge:{},license:{property:"data"},version:{property:"data"},name:{property:"data"},path:{property:"data"},size:{property:"data"},status:{property:"data"},language:{property:"data"},extension:{property:"data"},churn:{property:"data"},impact:{property:"data"},complexity:{property:"data"},latency:{property:"data"},duration:{property:"data"},frequency:{property:"data"},severity:{property:"data"},owner:{property:"object"},maintainer:{property:"object"},author:{property:"object"},reviewer:{property:"object"},parent:{property:"object"},dependency:{property:"object"},man:{plural:"men"},woman:{plural:"women"},person:{plural:"people"},child:{plural:"children"},boy:{},girl:{},baby:{},adult:{},friend:{},neighbor:{},stranger:{},guest:{},doctor:{},teacher:{},nurse:{},student:{},farmer:{},mother:{},father:{},brother:{},sister:{},family:{},king:{},queen:{},soldier:{},artist:{},writer:{},cook:{},group:{},crowd:{},audience:{},club:{},president:{},human:{},lawyer:{},driver:{},manager:{},officer:{},judge:{},priest:{},servant:{},butler:{},housekeeper:{},gardener:{},employee:{},boss:{},husband:{},wife:{plural:"wives"},son:{},daughter:{},grandmother:{},grandfather:{},citizen:{},customer:{},leader:{},champion:{},volunteer:{},resident:{},place:{},city:{},town:{},village:{},country:{},house:{},home:{},room:{},kitchen:{},bedroom:{},bathroom:{},school:{},hospital:{},shop:{},market:{},church:{},park:{},garden:{},street:{},road:{},bridge:{},farm:{},office:{},factory:{},museum:{},hotel:{},airport:{},castle:{},beach:{},forest:{},mountain:{},hat:{},shirt:{},coat:{},shoe:{},dress:{},clothing:{},chair:{},desk:{},lamp:{},portrait:{},bed:{},door:{},window:{},wall:{},roof:{},pen:{},paper:{},key:{},lock:{},box:{},car:{},bicycle:{},boat:{},train:{},wheel:{},knife:{plural:"knives"},spoon:{},fork:{},plate:{},cup:{},bottle:{},bag:{},money:{},coin:{},toy:{},machine:{},clock:{},phone:{},book:{},letter:{},umbrella:{},glove:{},sock:{},ring:{},watch:{},mirror:{},candle:{},ladder:{},hammer:{},basket:{},wallet:{},dog:{},cat:{},horse:{},cow:{},pig:{},sheep:{},bird:{},fish:{},mouse:{plural:"mice"},rabbit:{},rodent:{},bear:{},lion:{},tiger:{},elephant:{},snake:{},mole:{},groundhog:{},meerkat:{},tree:{},flower:{},grass:{},leaf:{plural:"leaves"},root:{},seed:{},fruit:{},water:{},air:{},fire:{},earth:{},stone:{},sand:{},gold:{},iron:{},rain:{},snow:{},wind:{},cloud:{},sun:{},moon:{},star:{},owl:{},wolf:{plural:"wolves"},frog:{},bee:{},ant:{},butterfly:{},spider:{},river:{},ocean:{},time:{},day:{},night:{},morning:{},evening:{},week:{},month:{},year:{},hour:{},minute:{},second:{},moment:{},season:{},spring:{},summer:{},winter:{},wedding:{},race:{},dozen:{},half:{plural:"halves"},amount:{},meeting:{},game:{},war:{},trip:{},birthday:{},holiday:{},autumn:{},century:{},body:{},head:{},hand:{},arm:{},leg:{},foot:{plural:"feet"},eye:{},ear:{},mouth:{},nose:{},hair:{},heart:{},blood:{},bone:{},skin:{},face:{},food:{},bread:{},meat:{},milk:{},egg:{},cheese:{},vegetable:{},meal:{},breakfast:{},dinner:{},drink:{},wine:{},tea:{},coffee:{},tongue:{},tooth:{plural:"teeth"},finger:{},toe:{},shoulder:{},knee:{},brain:{},lung:{},sugar:{},salt:{},word:{},story:{},news:{},idea:{},thought:{},mind:{},memory:{},dream:{},belief:{},love:{},hate:{},fear:{},joy:{},anger:{},hope:{},surprise:{},pride:{},song:{},music:{},sound:{},voice:{},picture:{},art:{},knowledge:{},opinion:{},reason:{},imagination:{},laughter:{},tear:{},smile:{},silence:{},object:{},location:{},quantity:{},organization:{},animal:{},plant:{},furniture:{},vehicle:{},insect:{},emotion:{},metal:{},liquid:{},weather:{},planet:{},jewelry:{},cutlery:{},government:{},material:{},draw:{},set:{},heavy:{},stand:{},free:{},pack:{},dead:{},pick:{},double:{},straight:{},cast:{},dry:{},bank:{},stamp:{},tender:{},fair:{},active:{},regular:{},blue:{},hack:{},band:{},brush:{},guard:{},master:{},transfer:{},firm:{},side:{},bull:{},mate:{},rank:{},board:{},brace:{},grade:{},better:{},course:{},natural:{},butt:{},camp:{},crop:{},date:{},fold:{},help:{},hunt:{},count:{},court:{},crush:{},major:{},march:{},tease:{},tough:{},flight:{},forward:{},division:{},commission:{},jam:{},rat:{},gray:{},hood:{},jerk:{},miss:{},pile:{},pool:{},rear:{},whip:{},bench:{},chain:{},cycle:{},grind:{},guide:{},stiff:{},troll:{},union:{},circle:{},carrier:{},defence:{},defense:{},radical:{},reserve:{},intimate:{},opposite:{},superior:{},grey:{},host:{},knot:{},left:{},lost:{},blind:{},crank:{},panel:{},rally:{},state:{},tramp:{},waver:{},clutch:{},living:{},runner:{},steady:{},stream:{},combine:{},company:{},convert:{},general:{},moderate:{},alternate:{},ace:{},crab:{},flop:{},fund:{},pair:{},rake:{},rock:{},sick:{},blade:{},cheat:{},sport:{},caller:{},column:{},couple:{},divine:{},pledge:{},simple:{},sponge:{},system:{},wanton:{},sleeper:{},business:{},associate:{},instrument:{},substitute:{},gun:{},sum:{},alto:{},best:{},buff:{},dear:{},mass:{},cream:{},creep:{},giant:{},labor:{},pilot:{},sneak:{},stack:{},staff:{},world:{},gutter:{},jumper:{},labour:{},lather:{},picket:{},reader:{},savage:{},captain:{},culture:{},monitor:{},neutral:{},unknown:{},utility:{},inferior:{},initiate:{},innocent:{},national:{},transpose:{},association:{},professional:{},bum:{},fan:{},law:{},deck:{},fool:{},join:{},kink:{},page:{},pink:{},stud:{},twin:{},clump:{},coach:{},dance:{},drone:{},extra:{},feast:{},fence:{},fleet:{},flock:{},ghost:{},clear:{},right:{},open:{},beat:{},back:{},block:{},see:{},keep:{},square:{},pitch:{},center:{},centre:{},top:{},post:{},field:{},spot:{},bar:{},end:{},frame:{},rough:{},address:{},quarter:{},position:{},land:{},bound:{},range:{},seat:{},dark:{},rail:{},cross:{},section:{},tip:{},plug:{},port:{},stall:{},corner:{},outside:{},dig:{},way:{},front:{},joint:{},patch:{},reach:{},thick:{},medium:{plural:"media"},dock:{},ruin:{},tack:{},floor:{},bottom:{},puddle:{},compound:{},retreat:{},mat:{},belt:{},dump:{},scene:{},space:{},border:{},common:{},cradle:{},inside:{},surface:{},lie:{},boot:{},clog:{},coil:{},nest:{},wire:{},yard:{},forge:{},limit:{},lodge:{},buffer:{},middle:{},capital:{},overhead:{},preserve:{},terminal:{},direction:{},hall:{},loft:{},plot:{},tape:{},grate:{},stoop:{},fringe:{},circuit:{},distance:{},derivation:{},bent:{},gate:{},mill:{},safe:{},sail:{},hedge:{},paint:{},parcel:{},sphere:{},bearing:{},profile:{},shelter:{},crossing:{},interior:{},reservation:{},area:{},bush:{},cork:{},dive:{},limb:{},raft:{},shed:{},zone:{},chase:{},cut:{},light:{},charge:{},check:{},work:{},stock:{},stick:{},flat:{},crack:{},press:{},settle:{},spread:{},wash:{},well:{},swing:{},fly:{},tap:{},stretch:{},shot:{},black:{},strip:{},separate:{},tie:{},rack:{},match:{},piece:{},shell:{},still:{},present:{},trim:{},spike:{},split:{},white:{},yield:{},squeeze:{},bolt:{},fret:{},choke:{},float:{},track:{},low:{},crown:{},screen:{},die:{plural:"dice"},pin:{},chip:{},mold:{},seal:{},draft:{},shade:{},shaft:{},stuff:{},switch:{},balance:{},reverse:{},subject:{},approach:{},beam:{},bill:{},card:{},link:{},sack:{},sink:{},trap:{},spare:{},credit:{},counter:{},express:{},positive:{},net:{},pay:{},ball:{},bond:{},bowl:{},horn:{},pole:{},wing:{},glass:{},grant:{},smack:{},collar:{},record:{},ruffle:{},silver:{},negative:{},cap:{},lap:{},pad:{},rag:{},rig:{},bend:{},clip:{},fine:{},flap:{},heel:{},pall:{},pump:{},gauge:{},image:{},plain:{},print:{},slick:{},spoil:{},clinch:{},gather:{},offset:{},pocket:{},relief:{},channel:{},whistle:{},irregular:{},transport:{},bat:{},ice:{},peg:{},pot:{},bust:{},grip:{},hole:{},nail:{},poke:{},slug:{},spat:{},stem:{},suit:{},yoke:{},flood:{},grand:{},gross:{},perch:{},slip:{},down:{},shoot:{},ground:{},discharge:{},solid:{},kill:{},slack:{},waste:{},rush:{},grain:{},shake:{},pit:{},mould:{},colour:{},render:{},mount:{},cutting:{},fill:{},flux:{},tail:{},plaster:{},swallow:{},concentrate:{},bay:{},gum:{},ray:{},slop:{},spur:{},extract:{},fat:{},hop:{},corn:{},rust:{},smut:{},label:{},stain:{},composition:{},gas:{},pip:{},duck:{},gall:{},lime:{},mint:{},tick:{},stalk:{},whiff:{},cement:{},rubber:{},conjugate:{},preparation:{},dun:{},dust:{},jade:{},mire:{},pulp:{},snag:{},bloom:{},caper:{},crude:{},fluid:{},frost:{},paste:{},rinse:{},steam:{},straw:{},corona:{},poison:{},refuse:{},savory:{},feather:{},ferment:{},organic:{},chestnut:{},mushroom:{},percolate:{},sublimate:{},synthetic:{},suspension:{},precipitate:{},cod:{},pet:{},rod:{},bunt:{},crow:{},hide:{},punk:{},vein:{},assay:{},goose:{plural:"geese"},olive:{},stray:{},trash:{},ginger:{},pepper:{},permit:{},polish:{},sorrel:{},blister:{},bristle:{},complex:{},filling:{},flicker:{},harvest:{},scollop:{},whiting:{},anteater:{},snowball:{},tincture:{},repellent:{},ink:{},lip:{},nag:{},rue:{},wad:{},acid:{},beak:{},bean:{},coal:{},dirt:{},fawn:{},fuel:{},lark:{},ling:{},mash:{},palm:{},pelt:{},plum:{},pony:{},pout:{},soil:{},stag:{},bream:{},brier:{},chalk:{},coral:{},fiber:{},fall:{},pass:{},lift:{},go:{},roll:{},drop:{},blow:{},return:{},strike:{},rise:{},snap:{},shift:{},twist:{},case:{},deal:{},start:{},deep:{},jump:{},step:{},stop:{},pound:{},advance:{},pop:{},flash:{},rest:{},crash:{},score:{},figure:{},leave:{},smash:{},stroke:{},first:{},sweep:{},even:{},flow:{},kick:{},heave:{},trace:{},opening:{},full:{},gain:{},jack:{},spin:{},wave:{},splash:{},bob:{},bang:{},dash:{},flick:{},hitch:{},prime:{},proof:{},passing:{},bit:{},click:{},knock:{},swell:{},trouble:{},collapse:{},movement:{},standard:{},variation:{},rap:{},boom:{},bump:{},clap:{},pace:{},peck:{},zero:{},blaze:{},speed:{},spell:{},treat:{},bounce:{},factor:{},little:{},plunge:{},scrape:{},single:{},ban:{},mix:{},one:{},mesh:{},roar:{},tilt:{},climb:{},flip:{},puff:{},bite:{},feed:{},bitter:{},chop:{},sour:{},special:{},crisp:{},tonic:{},scallop:{},mess:{},quick:{},smear:{},fillet:{},curl:{},malt:{},glaze:{},souse:{},breast:{},humour:{},draught:{},delicacy:{},dressing:{},transplant:{},hip:{},sop:{},kiss:{},mush:{},neck:{},belly:{},frank:{},jumble:{},junket:{},trifle:{},stomach:{},clot:{},shin:{},stew:{},tart:{},cheek:{},graft:{},molar:{},roast:{},spice:{},stout:{},sweat:{},groove:{},region:{},savoury:{},western:{},backbone:{},conserve:{},dominant:{},macerate:{},melancholy:{},cake:{},lens:{},loaf:{plural:"loaves"},menu:{},must:{},peel:{},pore:{},suds:{},butch:{},cling:{},curry:{},drool:{},honey:{},jerky:{},juice:{},mince:{},nasal:{},nerve:{},sauce:{},tract:{},dainty:{},entree:{},facial:{},relish:{},squash:{},brittle:{},caramel:{},cordial:{},fissure:{},oblique:{},adhesion:{},turnover:{},nonpareil:{},posterior:{},vegetation:{},ail:{},orb:{},pap:{},rum:{},brew:{},chew:{},hash:{},lard:{},rump:{},brine:{},dowdy:{},farce:{},flour:{},fudge:{},halal:{},icing:{},lunch:{},play:{},make:{},hold:{},close:{},mark:{},form:{},order:{},support:{},rule:{},sign:{},hang:{},drag:{},feel:{},find:{},shock:{},mean:{},offer:{},study:{},show:{},tone:{},flare:{},attack:{},act:{},life:{plural:"lives"},stay:{},think:{},secret:{},account:{},hurt:{},note:{},taste:{},report:{},measure:{},condition:{},cry:{},focus:{plural:"foci"},style:{},thing:{},title:{},recall:{},average:{},contract:{},dissolve:{},so:{},aim:{},bind:{},heat:{},know:{},stir:{},claim:{},power:{},demand:{},design:{},notice:{},source:{},upgrade:{},resolution:{},bid:{},skim:{},brand:{},curve:{},sight:{},smoke:{},digest:{},regard:{},passage:{},program:{},exposure:{},interest:{},character:{},projection:{},lay:{},curse:{},favor:{},remit:{},sense:{},slash:{},wedge:{},bubble:{},excuse:{},favour:{},invite:{},mantle:{},salute:{},stress:{},survey:{},temper:{},comfort:{},neglect:{},resolve:{},respect:{},torment:{},conflict:{},dispatch:{},standing:{},challenge:{},programme:{},background:{},conclusion:{},impression:{},particular:{},withdrawal:{},cite:{},echo:{},hail:{},rip:{},lot:{},great:{},relay:{},tenor:{},browse:{},bundle:{},chorus:{},cypher:{},fellow:{},litter:{},marine:{},native:{},occult:{},plague:{},rocker:{},scheme:{},series:{plural:"series"},social:{},streak:{},sucker:{},teaser:{},antique:{},battery:{},bracket:{},founder:{},gallery:{},liberal:{},starter:{},turnout:{},witness:{},diagonal:{},familiar:{},ordinary:{},prospect:{},sequence:{},aggregate:{},authority:{},community:{},dependent:{},desperate:{},patronage:{},primitive:{},principal:{},complement:{},engagement:{},foundation:{},generation:{},settlement:{},combination:{},lightweight:{},steamroller:{},subordinate:{},organisation:{},establishment:{},representative:{},con:{},fox:{},kid:{},pod:{},red:{},sex:{},spy:{},vet:{},aged:{},bore:{},diet:{},fare:{},gown:{},hawk:{},heap:{},herd:{},hive:{},lump:{},romp:{},sort:{},agent:{},alien:{},beard:{},brave:{},breed:{},brood:{},canon:{},craft:{},crazy:{},devil:{},dummy:{},equal:{},flake:{},groom:{},mound:{},organ:{},scrub:{},toast:{},troop:{},youth:{},colony:{},copper:{},cutter:{},escort:{},feeder:{},junior:{},maroon:{},matrix:{plural:"matrices"},modern:{},muscle:{},people:{},sector:{},shrink:{},tinker:{},topper:{},booster:{},gallant:{},hostile:{},marshal:{},network:{},nucleus:{plural:"nuclei"},premier:{},scourge:{},secular:{},sitting:{},snapper:{},suspect:{},swagger:{},traffic:{},variant:{},cardinal:{},derelict:{},domestic:{},favorite:{},finisher:{},graduate:{},humanist:{},infernal:{},magazine:{},manifold:{},minister:{},palatine:{},presence:{},receiver:{},relation:{},favourite:{},following:{},goldbrick:{},operative:{},sensitive:{},syndicate:{},complexion:{},mouthpiece:{},withdrawer:{},appointment:{},conjugation:{},constituent:{},heavyweight:{},incompetent:{},independent:{},replacement:{},underground:{},untouchable:{},conservative:{},administration:{},ape:{},gem:{},hob:{},sap:{},van:{},axis:{plural:"axes"},chap:{},char:{},crew:{},cult:{},duet:{},gang:{},hero:{},hire:{},lamb:{},lame:{},mute:{},nude:{},pawn:{},pill:{},sage:{},soul:{},tout:{},trio:{},ward:{},worm:{},bunch:{},crimp:{},dwarf:{},elect:{},flank:{},ideal:{},noble:{},octet:{},quack:{},saint:{},scrag:{},shark:{},shoal:{},silly:{},skunk:{},super:{},witch:{},zombi:{},agency:{},anchor:{},backup:{},batter:{},buster:{},canary:{},circus:{},dealer:{},domain:{},doomed:{},genius:{},gossip:{},herald:{},hoodoo:{},hopper:{},immune:{},jockey:{},legion:{},member:{},nature:{},orphan:{},parade:{},peanut:{},pillar:{},pirate:{},player:{},porter:{},pusher:{},putter:{},senior:{},septet:{},sestet:{},sextet:{},surety:{},tapper:{},tiller:{},zombie:{},adjunct:{},butcher:{},captive:{},cascade:{},chapter:{},charity:{},checker:{},chicane:{},chicken:{},climber:{},cognate:{},consort:{},cracker:{},dresser:{},gentile:{},invalid:{},knocker:{},lineage:{},mission:{},mixture:{},monster:{},offence:{},partner:{},pioneer:{},pitcher:{},quartet:{},quintet:{},recruit:{},referee:{},shooter:{},spoiler:{},sponsor:{},stemmer:{},steward:{},striker:{},terrace:{},alliance:{},castrate:{},designer:{},director:{},ensemble:{},faithful:{},friendly:{},mandarin:{},operator:{},romantic:{},accessory:{},annoyance:{},attendant:{},bourgeois:{},precedent:{},quadruple:{},reception:{},recession:{},religious:{},reprobate:{},satellite:{},selection:{},sensation:{},supporter:{},contingent:{},convention:{},expedition:{},incendiary:{},individual:{},masquerade:{},population:{},sweetheart:{},tubercular:{},confederate:{},cooperative:{},subdivision:{},territorial:{},transcriber:{},intelligence:{},registration:{},sophisticate:{},welterweight:{},revolutionary:{},ex:{},ass:{},cog:{},cub:{},den:{},dud:{},duo:{},ham:{},hog:{},mob:{},pro:{},deaf:{},dove:{},fate:{},five:{},folk:{},gull:{},jinx:{},mime:{},nark:{},nine:{},pest:{},prey:{},quad:{},rash:{},scab:{},sire:{},wisp:{},wood:{},zany:{},armor:{},batch:{},bogey:{},caste:{},chief:{},choir:{},clone:{},divan:{},drunk:{},elder:{},enemy:{},exile:{},faith:{},flirt:{},grunt:{},joker:{},lobby:{},louse:{plural:"lice"},pagan:{},pivot:{},racer:{},rebel:{},scout:{},siren:{},slave:{},swarm:{},timid:{},triad:{},tribe:{},armour:{},bearer:{},censor:{},choker:{},convoy:{},covert:{},damned:{},deputy:{},empire:{},goffer:{},gopher:{},huddle:{},killer:{},league:{},martyr:{},muster:{},mystic:{},outfit:{},packet:{},palace:{},passer:{},patrol:{},potter:{},quarry:{},rigger:{},ringer:{},rustic:{},scribe:{},sitter:{},slider:{},slouch:{},squire:{},squirt:{},stupid:{},summit:{},tailor:{},tenant:{},terror:{},tracer:{},turkey:{},turner:{},venter:{},voider:{},voodoo:{},walker:{},worthy:{},academy:{},agonist:{},amateur:{},ancient:{},banquet:{},cabinet:{},cashier:{},classic:{},commune:{},courser:{},crammer:{},current:{},divider:{},economy:{},edition:{},emperor:{},entrant:{},fireman:{},lookout:{},octette:{},orderly:{},painter:{},pervert:{},plotter:{},plunger:{},roaster:{},sampler:{},scanner:{},sellout:{},skimmer:{},skipper:{},society:{},soprano:{},spastic:{},spotter:{},stratum:{plural:"strata"},trimmer:{},tripper:{},trooper:{},tumbler:{},upstart:{},veteran:{},wheeler:{},academic:{},agnostic:{},aviation:{},backstop:{},baritone:{},calendar:{},casualty:{},colonial:{},divinity:{},fireball:{},homeless:{},huckster:{},marriage:{},militant:{},military:{},ministry:{},modifier:{},partisan:{},pedigree:{},possible:{},recorder:{},regiment:{},renegade:{},repeater:{},revenant:{},septette:{},sextette:{},shepherd:{},stalwart:{},stringer:{},stripper:{},whistler:{},affiliate:{},ascendant:{},bacchanal:{},canvasser:{},cockscomb:{},collector:{},comforter:{},commander:{},companion:{},conductor:{},crossover:{},eccentric:{},executive:{},fledgling:{},franchise:{},freelance:{},incumbent:{},mercenary:{},moderator:{},neighbour:{},newspaper:{},patriarch:{},patrician:{},portfolio:{},quartette:{},quintette:{},repertory:{},secretary:{},segregate:{},spearhead:{},stigmatic:{},summation:{},transient:{},trumpeter:{},voluntary:{},absolutism:{},anthropoid:{},apparition:{},assemblage:{},collective:{},contractor:{},delinquent:{},episcopate:{},exaltation:{},exposition:{},illiterate:{},judicature:{},leadership:{},lieutenant:{},minimalist:{},percussion:{},profligate:{},provincial:{},rendezvous:{},brotherhood:{},determinant:{},distributor:{},interpreter:{},stipendiary:{},analphabetic:{},antediluvian:{},civilisation:{},civilization:{},commonwealth:{},conglomerate:{},contemporary:{},cosmopolitan:{},humanitarian:{},neighborhood:{},thoroughbred:{},ultramontane:{},concatenation:{},featherweight:{},superordinate:{},classification:{},fundamentalist:{},cop:{},don:{},eon:{},gal:{},gob:{},god:{},hoe:{},kin:{},nan:{},pup:{},wag:{},wit:{},aeon:{},ally:{},bard:{},chum:{},clew:{},dean:{},fink:{},flak:{},geek:{},goof:{},hulk:{},idol:{},lady:{},loon:{},mace:{},para:{},ruck:{},seer:{},self:{plural:"selves"},adder:{},angel:{},augur:{},baron:{},blond:{},brick:{},brute:{},cabal:{},champ:{},comic:{},crier:{},decoy:{},demon:{},diner:{},diver:{},diwan:{},drove:{},envoy:{},fiend:{},flack:{},flier:{},flyer:{},freak:{},gaudy:{},harpy:{},horde:{},indie:{},jewel:{},leech:{},levee:{},liege:{},locus:{},loser:{},mimic:{},needy:{},nymph:{},oiler:{},poser:{},pupil:{},riser:{},roper:{},rummy:{},scold:{},squad:{},timer:{},tutor:{},usher:{},vicar:{},whale:{},wiper:{},affine:{},albino:{},angler:{},badass:{},baster:{},beggar:{},blonde:{},bomber:{},bowler:{},butter:{},carver:{},caster:{},chichi:{},clinic:{},closer:{},cohort:{},coiner:{},comber:{},cookie:{},cordon:{},corpus:{},cotter:{},cowboy:{},coyote:{},critic:{},dragon:{},drawer:{},drudge:{},eleven:{},ensign:{},estate:{},ethnic:{},exarch:{},finder:{},fodder:{},gaffer:{},gainer:{},galaxy:{},granny:{},hacker:{},hedger:{},heller:{},holder:{},honker:{},hooker:{},hotdog:{},inmate:{},intern:{},jungle:{},knight:{},kvetch:{},lineup:{},lovely:{},magpie:{},maiden:{},mailer:{},maniac:{},matron:{},miller:{},muller:{},nation:{},opener:{},ouster:{},packer:{},parrot:{},patron:{},peeler:{},peeper:{},polity:{},poster:{},powwow:{},punter:{},puppet:{},purdah:{},racist:{},rafter:{},ramrod:{},redact:{},regent:{},rusher:{},sailor:{},scorer:{},seeder:{},shaver:{},slaver:{},slicer:{},smoker:{},snitch:{},syntax:{},tacker:{},tagger:{},tanker:{},tartar:{},teller:{},thrush:{},trigon:{},troika:{},truant:{},tucker:{},tyrant:{},umpire:{},undoer:{},vestal:{},virgin:{},votary:{},warren:{},washer:{},wetter:{},winder:{},winner:{},wizard:{},admirer:{},amnesic:{},analyst:{},anomaly:{},aphasic:{},armorer:{},arrival:{},ascetic:{},auditor:{},baggage:{},bastion:{},biology:{},boarder:{},brahman:{},brahmin:{},breaker:{},caravan:{},clapper:{},cluster:{},coaster:{},cobbler:{},college:{},convict:{},council:{},counsel:{},coxcomb:{},crawler:{},creeper:{},crewman:{},crimper:{},darling:{},destiny:{},dragoon:{},dreamer:{},duality:{},echelon:{},ejector:{},fiddler:{},fighter:{},flasher:{},forbear:{},harrier:{},holdout:{},hostess:{},incubus:{},ingenue:{},justice:{},kachina:{},kindred:{},kingpin:{},macumba:{},manikin:{},marcher:{},married:{},newborn:{},notable:{},nursing:{},outpost:{},parvenu:{},patient:{},payroll:{},peasant:{},phalanx:{},phantom:{},planter:{},platoon:{},plodder:{},poacher:{},printer:{},prodigy:{},puncher:{},realist:{},redhead:{},revival:{},runaway:{},scholar:{},sharpie:{},skidder:{},slicker:{},slogger:{},smasher:{},snorter:{},snuffer:{},spinner:{},splicer:{},stalker:{},stamper:{},standby:{},stepper:{},striper:{},sweeper:{},thrower:{},triplet:{},utopian:{},utterer:{},voucher:{},washout:{},watcher:{},wiggler:{},wrecker:{},affluent:{},armourer:{},attender:{},bacchant:{},bachelor:{},bankrupt:{},bisexual:{},bondsman:{},cautious:{},congress:{},corporal:{},creature:{},decadent:{},defeated:{},delegate:{},diabetic:{},dictator:{},dyslexic:{},effector:{},exponent:{},flagging:{},freshman:{},fugitive:{},futurist:{},garrison:{},greyback:{},hangover:{},humanism:{},immortal:{},juvenile:{},lapidary:{},mainstay:{},mannikin:{},maverick:{},mechanic:{},minority:{},minstrel:{},mistress:{},monotype:{},mutation:{},nativist:{},neophyte:{},neurotic:{},newsroom:{},nobility:{},opponent:{},pacifier:{},pantheon:{},planting:{},probable:{},producer:{},recusant:{},referral:{},reminder:{},retainer:{},ruralism:{},scalawag:{},scrubber:{},searcher:{},sergeant:{},sociable:{},songster:{},splitter:{},squadron:{},straggle:{},strawman:{},survivor:{},taxonomy:{},treasury:{},vanguard:{},virtuoso:{},walloper:{},warhorse:{},yearling:{},alcoholic:{},anorectic:{},artificer:{},artillery:{},attracter:{},attractor:{},automaton:{},auxiliary:{},barbarian:{},bombshell:{},brokerage:{},coalition:{},concourse:{},contralto:{},counselor:{},crewwoman:{},cyberpunk:{},defaulter:{},deliverer:{},democracy:{},dependant:{},descender:{},dissident:{},dyspeptic:{},feudatory:{},firewoman:{},flyweight:{},incurable:{},institute:{},insurgent:{},intellect:{},introvert:{},mandatory:{},mendicant:{},middleman:{},navigator:{},organiser:{},organizer:{},pluralism:{},pluralist:{},pothunter:{},precursor:{},predictor:{},presenter:{},pretender:{},processor:{},proconsul:{},publisher:{},quintuple:{},registrar:{},regulator:{},scallywag:{},scavenger:{},scrambler:{},scratcher:{},serration:{},singleton:{},stargazer:{},stockpile:{},successor:{},surrogate:{},symbolism:{},temporary:{},throwback:{},trickster:{},warrantee:{},womanhood:{},antagonist:{},attendance:{},blackguard:{},bondswoman:{},chancellor:{},classifier:{},conference:{},conformist:{},counsellor:{},crossroads:{},descendant:{},descendent:{},doorkeeper:{},embodiment:{},expatriate:{},federation:{},fellowship:{},filibuster:{},forerunner:{},fratricide:{},grandstand:{},mastermind:{},minstrelsy:{},missionary:{},ordination:{},plantation:{},powerhouse:{},quadruplet:{},quintuplet:{},repatriate:{},republican:{},respondent:{},rubberneck:{},salamander:{},scholastic:{},separatism:{},sisterhood:{},subscriber:{},subsidiary:{},supplicant:{},suppresser:{},suppressor:{},timekeeper:{},translator:{},university:{},wallflower:{},abomination:{},academician:{},agriculture:{},anachronism:{},antiquarian:{},beneficiary:{},bureaucracy:{},clairvoyant:{},conditioner:{},confederacy:{},consumptive:{},deification:{},enlightened:{},incarnation:{},lilliputian:{},middlewoman:{},narcoleptic:{},nationalist:{},partnership:{},peacekeeper:{},peripatetic:{},pontificate:{},progression:{},prosecution:{},quarterback:{},recessional:{},romanticist:{},shipbuilder:{},transmitter:{},transsexual:{},underwriter:{},undesirable:{},utilitarian:{},acquaintance:{},bantamweight:{},collaborator:{},congregation:{},conservatory:{},countertenor:{},demonstrator:{},denomination:{},headquarters:{},illegitimate:{},investigator:{},metropolitan:{},middleweight:{},noncombatant:{},philharmonic:{},schoolmaster:{},sharpshooter:{},totalitarian:{},authoritarian:{},confederation:{},correspondent:{},reincarnation:{},schizophrenic:{},supernumerary:{},categorization:{},tatterdemalion:{},instrumentality:{},internationalist:{},bey:{},cox:{},cur:{},few:{},foe:{},hag:{},lad:{},mod:{},obi:{},sib:{},aide:{},amah:{},anti:{},army:{},beau:{},bevy:{},bogy:{},chit:{},clod:{},coon:{},czar:{},dada:{},dame:{},derp:{},dodo:{},dude:{},duke:{},dupe:{},gild:{},giro:{},goat:{},goon:{},grad:{},guru:{},heir:{},hobo:{},hunk:{},jilt:{},jock:{},jury:{},khan:{},maid:{},naif:{},navy:{},nerd:{},peri:{},pimp:{},putz:{},sect:{},suer:{},swot:{},tuft:{},adept:{},baker:{},basso:{},beast:{},bride:{},bunny:{},cadre:{},comer:{},cooky:{},corps:{},covey:{},deist:{},edger:{},elite:{},emcee:{},enate:{},faery:{},fatty:{},fauna:{},felon:{},filer:{},flora:{},folks:{},forum:{},genus:{plural:"genera"},ghoul:{},gipsy:{},giver:{},gnome:{},grove:{},gypsy:{},hajji:{},hakim:{},junky:{},knave:{},lefty:{},leper:{},loony:{},macho:{},madam:{},magus:{},medic:{},mezzo:{},miler:{},mooch:{},mufti:{},nabob:{},nexus:{},ninja:{},obeah:{},parer:{},pigmy:{},poilu:{},ponce:{},prior:{},proxy:{},puppy:{},pygmy:{},quint:{},raver:{},rover:{},satyr:{},scamp:{},sheik:{},shill:{},shrew:{},sibyl:{},sissy:{},slain:{},smith:{},snoop:{},sprog:{},stoic:{},sylph:{},taker:{},thane:{},toady:{},totem:{},trier:{},tryst:{},tuner:{},twirp:{},uncle:{},valet:{},vegan:{},vixen:{},waker:{},widow:{},wight:{},wirer:{},yenta:{},agnate:{},alexic:{},amazon:{},audile:{},avatar:{},avower:{},bagger:{},bagman:{},banker:{},barber:{},barker:{},bather:{},bawler:{},beater:{},beldam:{},bidder:{},boater:{},brewer:{},broker:{},brunet:{},bureau:{},caddie:{},camper:{},cantor:{},caucus:{},chaser:{},cherub:{},chosen:{},coeval:{},cooper:{},coquet:{},cottar:{},craven:{},cubist:{},daemon:{},deacon:{},digger:{},dodger:{},dowser:{},duette:{},dunker:{},egoist:{},eldest:{},eparch:{},erotic:{},eyeful:{},faller:{},fitter:{},flunky:{},forger:{},framer:{},gaggle:{},gagman:{},gamine:{},gasbag:{},gillie:{},goalie:{},gouger:{},grouch:{},gunman:{},gunner:{},hamlet:{},hanger:{},hawker:{},heaver:{},hermit:{},hitter:{},hummer:{},iceman:{},joiner:{},junkie:{},jurist:{},keeper:{},kelpie:{},kisser:{},lackey:{},lector:{},lifter:{},lister:{},lizard:{},loader:{},loaner:{},logjam:{},longer:{},lubber:{},lumper:{},lyceum:{},madcap:{},maenad:{},maimed:{},masher:{},medico:{},menial:{},midden:{},midget:{},minder:{},moiety:{},motile:{},nester:{},oblate:{},oilman:{},parish:{},paster:{},pelter:{},phylum:{},picker:{},plenum:{},police:{},pruner:{},psyche:{},puller:{},python:{},rabble:{},raider:{},raiser:{},ranger:{},ranker:{},rapper:{},reaper:{},redcap:{},reeler:{},regime:{},renter:{},rifler:{},romper:{},sachem:{},salter:{},sawyer:{},sealer:{},seeker:{},sender:{},sexist:{},shaker:{},shaper:{},sharpy:{},signer:{},silvan:{},sleuth:{},smiler:{},sorter:{},sphinx:{},stager:{},stater:{},supper:{},sylvan:{},talent:{},tanner:{},tester:{},theist:{},throng:{},tilter:{},tipper:{},toller:{},tosser:{},tourer:{},townie:{},trusty:{},varlet:{},vermin:{},vestry:{},victor:{},virago:{},voicer:{},waster:{},weasel:{},weaver:{},weeder:{},weeper:{},weirdo:{},whaler:{},winker:{},wraith:{},wretch:{},yakuza:{},yeoman:{},adapter:{},admiral:{},airhead:{},amalgam:{},animist:{},aphakic:{},applier:{},arbiter:{},armiger:{},atheist:{},attache:{},babbler:{},baffled:{},beldame:{},beloved:{},berserk:{},bondman:{},bounder:{},brigade:{},browser:{},buffoon:{},bulimic:{},burgher:{},caitiff:{},carload:{},catcher:{},cavalry:{},chachka:{},changer:{},charmer:{},chemist:{},cocotte:{},collage:{},compere:{},shadow:{},layer:{},north:{},orbit:{},trend:{},truss:{},vault:{},bunker:{},harbor:{},orient:{},origin:{},resort:{},safety:{},target:{},chamber:{},extreme:{},harbour:{},kingdom:{},mandate:{},outline:{},station:{},blockade:{},darkness:{},overlook:{},landscape:{},northeast:{},northwest:{},partition:{},southeast:{},southwest:{},structure:{},atmosphere:{},lug:{},tee:{},balk:{},burr:{},cage:{},drip:{},east:{},fort:{},hoop:{},west:{},cleat:{},fluke:{},scour:{},south:{},beacon:{},closet:{},duplex:{},radius:{plural:"radii"},vacuum:{},wattle:{},canteen:{},grounds:{},cloister:{},pinnacle:{},property:{},surround:{},terminus:{},anchorage:{},barricade:{},honeycomb:{},turnaround:{},institution:{},termination:{},cab:{},dam:{},brim:{},calk:{},dome:{},goal:{},hill:{},hull:{},knob:{},prop:{},seam:{},site:{},turf:{},apron:{},arena:{},baulk:{},cabin:{},grill:{},groin:{},haunt:{},lever:{},niche:{},privy:{},works:{},airway:{},barren:{},corral:{},dugout:{},fender:{},galley:{},hurdle:{},lounge:{},outlet:{},refuge:{},sconce:{},sprawl:{},temple:{},toilet:{},wicket:{},barrack:{},bulwark:{},buttery:{},cornice:{},grating:{},landing:{},leeward:{},maximum:{},pasture:{},salient:{},shingle:{},squinch:{},surgery:{},building:{},cylinder:{},downtown:{},fountain:{},landmark:{},munition:{},quadrant:{},rearward:{},sideline:{},windward:{},homestead:{},multiplex:{},perfumery:{},residence:{},stretcher:{},substrate:{},excavation:{},silhouette:{},convenience:{},culmination:{},declination:{},architecture:{},spa:{},aery:{},brow:{},bung:{},dike:{},flue:{},hell:{},tent:{},abbey:{},aisle:{},arbor:{},attic:{},booth:{},brink:{},disco:{},oxbow:{},oxeye:{},quoin:{},realm:{},salon:{},villa:{},whorl:{},barony:{},barrow:{},bazaar:{},billet:{},bustle:{},canton:{},casing:{},cellar:{},cooler:{},garage:{},ghetto:{},grille:{},hearth:{},locker:{},midway:{},muffle:{},oracle:{},remise:{},saloon:{},stocks:{},studio:{},tiptop:{},uptown:{},volute:{},arsenal:{},chassis:{},cockpit:{},commons:{},cubicle:{},dockage:{},fairway:{},fencing:{},gondola:{},heading:{},hotspot:{},lattice:{},lodging:{},minimum:{},moorage:{},pannier:{},rattrap:{},rootage:{},stowage:{},theater:{},theatre:{},vacuity:{},baseline:{},butchery:{},buttress:{},clearing:{},crosscut:{},domicile:{},erection:{},exterior:{},fanlight:{},fastness:{},firewall:{},foothold:{},frontier:{},lavatory:{},memorial:{},monument:{},mortuary:{},overhang:{},pedestal:{},scenario:{},solitude:{},sprocket:{},stockade:{},stoppage:{},vaulting:{},bombproof:{},cathedral:{},fundament:{},hindrance:{},panhandle:{},proximity:{},resonator:{},sanctuary:{},territory:{},watershed:{},confluence:{},department:{},encampment:{},flashpoint:{},groundwork:{},hinderance:{},quartering:{},substratum:{},underbelly:{},breadbasket:{},columbarium:{},destination:{},engineering:{},equinoctial:{},planetarium:{},penitentiary:{},circumference:{},confectionery:{},fortification:{},hub:{},hut:{},lee:{},sty:{},acme:{},apex:{},barn:{},brig:{},coop:{},digs:{},holy:{},jail:{},jook:{},juke:{},loge:{},mall:{},nook:{},pave:{},sash:{},silo:{},slum:{},tope:{},weir:{},abode:{},aerie:{},altar:{},bazar:{},detox:{},haven:{},heath:{},hutch:{},kraal:{},lager:{},manor:{},manse:{},navel:{},oasis:{plural:"oases"},opera:{},paddy:{},plaza:{},pylon:{},rodeo:{},shire:{},spile:{},sprag:{},venue:{},visor:{},apogee:{},arcade:{},ashram:{},asylum:{},atrium:{},bagnio:{},bailey:{},barrio:{},belfry:{},boards:{},casino:{},chapel:{},county:{},creche:{},cupola:{},deckle:{},fraise:{},haymow:{},hostel:{},kennel:{},lancet:{},larder:{},lockup:{},mihrab:{},parlor:{},plaque:{},prefab:{},prison:{},spigot:{},stacks:{},tampon:{},turret:{},vertex:{},zodiac:{},automat:{},balcony:{},batwing:{},benthos:{},borough:{},bubbler:{},bullpen:{},cabaret:{},caboose:{},chantry:{},convent:{},deanery:{},demesne:{},derrick:{},desktop:{},drydock:{},dukedom:{},dungeon:{},earldom:{},earplug:{},embassy:{},emirate:{},eparchy:{},equinox:{},fiefdom:{},florist:{},flyover:{},framing:{},funfair:{},grocery:{},hayrack:{},hospice:{},khanate:{},lunette:{},mansion:{},marquee:{},masonry:{},matting:{},midland:{},mooring:{},narthex:{},nirvana:{},obelisk:{},outback:{},parapet:{},parlour:{},pinhead:{},railing:{},rathole:{},redoubt:{},ribbing:{},rotunda:{},sanctum:{},sawmill:{},shipway:{},shoebox:{},stopple:{},tambour:{},transom:{},trellis:{},trestle:{},tribune:{},vantage:{},abutment:{},airspace:{},ambiance:{},ambience:{},backside:{},ballpark:{},basement:{},basilica:{},bioscope:{},bodywork:{},brattice:{},diggings:{},doghouse:{},dominion:{},entrepot:{},environs:{},extremum:{},farmland:{},fireside:{},hacienda:{},hideaway:{},imperium:{},jalousie:{},littoral:{},mantelet:{},mounting:{},nailhead:{},outdoors:{},palisade:{},pharmacy:{},porthole:{},province:{},revolver:{},seascape:{},sidewall:{},steerage:{},stopover:{},suburbia:{},sudatory:{},sweatbox:{},tailgate:{},turnpike:{},wellhead:{},backwater:{},bailiwick:{},beachhead:{},belvedere:{},caliphate:{},caparison:{},cellarage:{},chandlery:{},cloakroom:{},colonnade:{},cookhouse:{},couchette:{},crematory:{},crownwork:{},cubbyhole:{},dollhouse:{},dormitory:{},dripstone:{},fieldwork:{},fireguard:{},forefront:{},guardroom:{},hatchback:{},isoclinal:{},lazaretto:{},lineation:{},mezzanine:{},millinery:{},orphanage:{},outfitter:{},pleasance:{},princedom:{},revetment:{},roadblock:{},scrapheap:{},shrubbery:{},viewpoint:{},viscounty:{},workhouse:{},architrave:{},birthplace:{},borderline:{},bridgehead:{},brownstone:{},chokepoint:{},commissary:{},courthouse:{},escarpment:{},greenhouse:{},ironmonger:{},justiciary:{},laboratory:{},lamination:{},maisonette:{},metropolis:{},obstructor:{},panopticon:{},playground:{},prefecture:{},proscenium:{},quadrangle:{},rotisserie:{},sanatorium:{},suzerainty:{},tenderloin:{},triclinium:{},wellspring:{},wheelhouse:{},condominium:{},conventicle:{},crematorium:{},crenelation:{},demarcation:{},maisonnette:{},observatory:{},reformatory:{},superstrate:{},tobacconist:{},trusteeship:{},wainscoting:{},amphitheater:{},amphitheatre:{},chapterhouse:{},clotheshorse:{},delicatessen:{},fountainhead:{},haberdashery:{},municipality:{},packinghouse:{},patriarchate:{},retrenchment:{},substructure:{},superstratum:{},surroundings:{},wainscotting:{},juxtaposition:{},infrastructure:{},dec:{},inn:{},loo:{},pub:{},burg:{},cafe:{},deli:{},dorm:{},hank:{},iglu:{},kirk:{},lair:{},lawn:{},mart:{},nave:{},oast:{},rink:{},souk:{},tine:{},tipi:{},veld:{},ways:{},wold:{},yurt:{},apsis:{},burgh:{},condo:{},cubby:{},cuddy:{},dacha:{},duchy:{},duomo:{},eaves:{},flies:{},gable:{},glade:{},gulag:{},harem:{},hogan:{},igloo:{},lanai:{},layby:{},mecca:{},midst:{},motel:{},oriel:{},parts:{},patio:{},polls:{},qibla:{},roads:{},rooms:{},sauna:{},skein:{},socle:{},soddy:{},sodom:{},spire:{},stoep:{},stupa:{},tenon:{},tepee:{},tupek:{},tupik:{},veldt:{},weald:{},abatis:{},abbacy:{},alcove:{},apiary:{},arbour:{},aviary:{},bedsit:{},bethel:{},bodega:{},bounds:{},bowels:{},cabana:{},calkin:{},campus:{},carrel:{},casbah:{},casern:{},chalet:{},depths:{},dolmen:{},donjon:{},dormer:{},durbar:{},eatery:{},escarp:{},fipple:{},flange:{},flyway:{},friary:{},furket:{},gantry:{},garret:{},hangar:{},hareem:{},hayrig:{},imaret:{},isobar:{},isohel:{},isolex:{},kasbah:{},laager:{},locale:{},loggia:{},marina:{},masjid:{},meadow:{},medina:{},menhir:{},merlon:{},midair:{},morgue:{},mosque:{},mudhif:{},musjid:{},pagoda:{},paling:{},pantry:{},parvis:{},pelmet:{},piazza:{},pigsty:{},plinth:{},priory:{},pueblo:{},radome:{},setoff:{},skybox:{},skyway:{},stalls:{},storey:{},suburb:{},tenter:{},upside:{},volary:{},wigwam:{},wikiup:{},winery:{},abattis:{},airdock:{},airlock:{},alcazar:{},antapex:{},apadana:{},apojove:{},apolune:{},athanor:{},barroom:{},bascule:{},bedside:{},beeline:{},borstal:{},boudoir:{},brewery:{},brewpub:{},brothel:{},campong:{},cannery:{},capitol:{},carport:{},carrell:{},chancel:{},chateau:{},citadel:{},coaming:{},corncob:{},cottage:{},cowbarn:{},cowshed:{},cowtown:{},crinion:{},dinette:{},diocese:{},earshot:{},edifice:{},enclave:{},exurbia:{},eyeshot:{},fantail:{},feedlot:{},firebox:{},screw:{},share:{},sheet:{},slice:{},slide:{},spill:{},stage:{},stake:{},tread:{},paddle:{},weight:{},canvass:{},compact:{},undercut:{},representation:{},fin:{},gag:{},jet:{},tug:{},bark:{},bunk:{},drum:{},mask:{},pipe:{},reel:{},scan:{},blank:{},drill:{},plumb:{},plume:{},shank:{},sling:{},spray:{},pickup:{},saddle:{},trench:{},capsule:{},security:{},sacrifice:{},technical:{},can:{},jar:{},map:{},ply:{},rib:{},rim:{},web:{},bell:{},buck:{},claw:{},comb:{},copy:{},crib:{},dish:{},fake:{},foil:{},grab:{},kite:{},ramp:{},rent:{},slot:{},spit:{},tank:{},bosom:{},cable:{},charm:{},drain:{},grave:{},price:{},skirt:{},stool:{},strap:{},stump:{},trail:{},access:{},cannon:{},fiddle:{},formal:{},insert:{},launch:{},purple:{},reward:{},strand:{},tackle:{},display:{},floater:{},incline:{},limited:{},portion:{},torpedo:{},overcast:{},puncture:{},broadside:{},duplicate:{},submarine:{},surcharge:{},production:{},interchange:{},bus:{},due:{},gap:{},jaw:{},lag:{},nut:{},tin:{},win:{},arch:{},bail:{},cell:{},dope:{},fell:{},film:{},lace:{},lash:{},mail:{},pale:{},purl:{},rate:{},skid:{},sole:{},spar:{},tuck:{},vamp:{},vent:{},vest:{},brake:{},brass:{},chuck:{},cramp:{},crest:{},drape:{},elbow:{},habit:{},lease:{},lower:{},prize:{},roach:{},royal:{},scrap:{},slate:{},snare:{},snuff:{},total:{},trump:{},beaver:{},canvas:{},future:{},handle:{},header:{},jacket:{},motley:{},muzzle:{},quiver:{},rocket:{},roller:{},staple:{},wrench:{},compass:{},element:{},exhaust:{},frontal:{},thunder:{},transit:{},upstage:{},traverse:{},accession:{},allowance:{},guarantee:{},promenade:{},shipwreck:{},attachment:{},protection:{},perpendicular:{},aid:{},gig:{},gin:{},nap:{},oil:{},ram:{},bead:{},bulb:{},curb:{},dart:{},daub:{},dial:{},dose:{},exit:{},fuse:{},goad:{},item:{},knit:{},plan:{},rein:{},swag:{},veil:{},alarm:{},chart:{},cinch:{},clasp:{},eagle:{},entry:{},fluff:{},gouge:{},lance:{},meter:{},miter:{},pouch:{},probe:{},punch:{},purse:{},sable:{},scuff:{},shear:{},stern:{},taper:{},thumb:{},wharf:{},whisk:{},barrel:{},beetle:{},bronze:{},burden:{},congee:{},fleece:{},glossy:{},halter:{},limber:{},margin:{},mobile:{},needle:{},remote:{},shroud:{},sketch:{},splice:{},stripe:{},toggle:{},trough:{},volume:{},ballast:{},binding:{},blanket:{},costume:{},crackle:{},crystal:{},diamond:{},fitting:{},graphic:{},harness:{},premium:{},product:{},pyramid:{},sandbag:{},squelch:{},trammel:{},uniform:{},venture:{},warrant:{},wildcat:{},working:{},assembly:{},charcoal:{},discount:{},envelope:{},imperial:{},ligature:{},original:{},specific:{},treasure:{},vertical:{},deduction:{},distemper:{},inventory:{},objective:{},reversion:{},whitewash:{},supplement:{},contrivance:{},convertible:{},inspiration:{},intersection:{},counterbalance:{},bet:{},gel:{},gut:{},jag:{},jig:{},pan:{},pry:{},tab:{},tax:{},zip:{},bait:{},barb:{},bomb:{},cone:{},cuff:{},dado:{},disk:{},gear:{},gore:{},grid:{},harp:{},loom:{},main:{},pant:{},pike:{},prod:{},reef:{},ruff:{},sham:{},tare:{},tidy:{},tire:{},toll:{},award:{},basic:{},basin:{},baton:{},birch:{},braid:{},broom:{},clack:{},cloak:{},clout:{},crock:{},fagot:{},ferry:{},filet:{},forte:{},found:{},frail:{},jolly:{},motor:{},pedal:{},potty:{},radio:{},rivet:{},scarf:{},shore:{},shunt:{},sieve:{},splat:{},splay:{},stave:{},steal:{},steel:{},thong:{},tithe:{},torch:{},trunk:{},twine:{},upper:{},valve:{},weave:{},bridle:{},buckle:{},buffet:{},carpet:{},cotton:{},custom:{},devise:{},enamel:{},entail:{},furrow:{},girdle:{},hobble:{},mangle:{},mosaic:{},motive:{},pallet:{},pencil:{},pinion:{},powder:{},radial:{},rattle:{},rebate:{},rumble:{},shield:{},shimmy:{},shovel:{},sledge:{},sluice:{},tablet:{},throne:{},timber:{},tinsel:{},uplift:{},benefit:{},bombard:{},bootleg:{},console:{},default:{},forfeit:{},freight:{},gantlet:{},generic:{},grapple:{},journal:{},loading:{},molding:{},overlap:{},pigment:{},plastic:{},salvage:{},scooter:{},scuffle:{},spindle:{},steamer:{},stopper:{},upright:{},carriage:{},catapult:{},facility:{},laminate:{},medicine:{},offstage:{},overload:{},plastron:{},railroad:{},retrofit:{},strickle:{},throttle:{},whipping:{},wireless:{},automatic:{},blackjack:{},blackwash:{},foliation:{},interlock:{},roughcast:{},threshold:{},antiseptic:{},camouflage:{},incidental:{},intangible:{},preventive:{},reversible:{},watercolor:{},maintenance:{},watercolour:{},differential:{},prescription:{},preventative:{},prophylactic:{},reproduction:{},transcription:{},transportation:{},fob:{},guy:{},hem:{},jug:{},kit:{},saw:{},cane:{},cart:{},clam:{},coif:{},cosy:{},cozy:{},disc:{},felt:{},gash:{},hone:{},hose:{},keel:{},loot:{},luff:{},lure:{},mast:{},mend:{},mine:{},muff:{},nuke:{},plow:{},robe:{},ruby:{},snip:{},soap:{},spud:{},swab:{},tile:{},till:{},tram:{},vane:{},wand:{},weed:{},weld:{},welt:{},audio:{},audit:{},baste:{},bilge:{},brail:{},bugle:{},canal:{},chest:{},chock:{},conge:{},couch:{},crape:{},crepe:{},crook:{},flute:{},frill:{},frock:{},fusee:{},hoist:{},inset:{},kitty:{},leash:{},liner:{},mixer:{},noose:{},novel:{},pearl:{},piano:{},plait:{},quill:{},reset:{},roost:{},saber:{},sabre:{},scull:{},spear:{},squab:{},stilt:{},sulky:{},video:{},vomit:{},wagon:{},aerial:{},armory:{},baffle:{},banner:{},batten:{},binder:{},bodkin:{},bypass:{},canopy:{},chisel:{},clench:{},dollar:{},dredge:{},drogue:{},duster:{},engine:{},excise:{},facing:{},funnel:{},garner:{},hamper:{},joggle:{},kettle:{},lining:{},livery:{},lumber:{},marble:{},mortar:{},mousse:{},nickel:{},ocular:{},payoff:{},pestle:{},piping:{},pommel:{},profit:{},puzzle:{},ransom:{},ration:{},rental:{},ribbon:{},rotary:{},runway:{},saucer:{},seesaw:{},siphon:{},suture:{},tattoo:{},thatch:{},throat:{},tunnel:{},turtle:{},wealth:{},acrylic:{},armoury:{},balloon:{},bargain:{},beehive:{},blinker:{},bolster:{},caisson:{},casting:{},ceiling:{},chariot:{},chopper:{},clarion:{},clinker:{},clipper:{},cowhide:{},earnest:{},elastic:{},expense:{},festoon:{},fortune:{},garnish:{},gravure:{},grinder:{},killing:{},linkage:{},novelty:{},overall:{},overlay:{},pallium:{},perfume:{},pillory:{},pointer:{},ringlet:{},rosette:{},segment:{},shuttle:{},staging:{},trailer:{},trumpet:{},unction:{},barbecue:{},barbeque:{},disguise:{},electric:{},elevated:{},fraction:{},gauntlet:{},gossamer:{},heritage:{},homespun:{},ironclad:{},lifeline:{},lighting:{},mackinaw:{},moulding:{},pinpoint:{},pinwheel:{},poundage:{},sanguine:{},sapphire:{},scribble:{},triangle:{},underlay:{},upstairs:{},virginal:{},admission:{},amphibian:{},backstage:{},capillary:{},cartridge:{},cartwheel:{},cathartic:{},condenser:{},damascene:{},depiction:{},diaphragm:{},medallion:{},overdrive:{},pacemaker:{},reservoir:{},screening:{},sectional:{},solitaire:{},spotlight:{},undercoat:{},assessment:{},bottleneck:{},equatorial:{},overburden:{},pigeonhole:{},pocketbook:{},pontifical:{},refractory:{},reparation:{},roundabout:{},simulation:{},waterproof:{},accelerator:{},certificate:{},inheritance:{},installment:{},restorative:{},ventilation:{},modification:{},subscription:{},hospitalization:{},instrumentation:{},ax:{},axe:{},bib:{},bin:{},bur:{},cot:{},fee:{},fur:{},jib:{},lid:{},six:{},ten:{},tub:{},two:{},bath:{},bike:{},cash:{},coke:{},cope:{},cowl:{},cusp:{},darn:{},debt:{},dice:{},dory:{},duct:{},fore:{},four:{},gaff:{},gage:{},gong:{},helm:{},hemp:{},icon:{},iris:{},junk:{},kern:{},loan:{},maul:{},mink:{},pane:{},pier:{},quid:{},reed:{},rook:{},scum:{},semi:{},sump:{},swob:{},taxi:{},vice:{},ware:{},wool:{},yarn:{},yawl:{},annex:{},atlas:{},barge:{},bevel:{},chaff:{},chute:{},clamp:{},crane:{},crate:{},cubeb:{},dandy:{},dicky:{},dinky:{},dolly:{},dower:{},eight:{},fifty:{},flail:{},floss:{},folio:{},fuzee:{},genre:{},girth:{},gourd:{},grape:{},hinge:{},hobby:{},inlay:{},japan:{},ladle:{},latch:{},linen:{},means:{},mitre:{},motif:{},mulct:{},pique:{},quilt:{},quirk:{},quota:{},rifle:{},rotor:{},setup:{},seven:{},shred:{},skate:{},spade:{},spool:{},spout:{},strut:{},three:{},toner:{},trawl:{},truck:{},twill:{},virtu:{},alpaca:{},anklet:{},argyle:{},argyll:{},arnica:{},balsam:{},bender:{},birdie:{},bishop:{},blower:{},blowup:{},bolero:{},bonnet:{},bounty:{},budget:{},bullet:{},cachet:{},carbon:{},casket:{},castor:{},claxon:{},cobble:{},cobweb:{},collet:{},crenel:{},cutoff:{},cutout:{},damask:{},damper:{},dibble:{},dickey:{},dipper:{},domino:{},douche:{},dragee:{},equity:{},eyelet:{},fetish:{},foible:{},fresco:{},gaiter:{},gibbet:{},gusset:{},heckle:{},hooter:{},horror:{},hunter:{},intake:{},jigger:{},lacing:{},lappet:{},makeup:{},making:{},mallet:{},marker:{},patina:{},paving:{},platen:{},plough:{},poleax:{},portal:{},primer:{},rabbet:{},rattan:{},refill:{},retort:{},revere:{},screed:{},sheath:{},sinker:{},socket:{},splint:{},stereo:{},syphon:{},tamper:{},tandem:{},tarmac:{},tenure:{},ticker:{},trepan:{},twenty:{},velvet:{},veneer:{},vessel:{},vicuna:{},backing:{},bandage:{},bobsled:{},carving:{},central:{},chamfer:{},chequer:{},cistern:{},cleaner:{},cleanup:{},coinage:{},crochet:{},cruiser:{},curtain:{},dilator:{},distaff:{},emerald:{},etching:{},flannel:{},flounce:{},footing:{},gangway:{},garbage:{},garland:{},gauffer:{},gelatin:{},grizzle:{},hanging:{},haywire:{},lamella:{},laniard:{},lanyard:{},lashing:{},lockage:{},lounger:{},manakin:{},masking:{},meshing:{},mileage:{},mintage:{},mortice:{},mortise:{},movable:{},muffler:{},palette:{},pendant:{},pendent:{},pennant:{},pillbox:{},poleaxe:{},portage:{},pottery:{},priming:{},quarrel:{},readout:{},retread:{},roundel:{},rubbing:{},scupper:{},scuttle:{},serpent:{},shampoo:{},shellac:{},shutter:{},snaffle:{},snorkel:{},spangle:{},spouter:{},stabile:{},stinker:{},tankage:{},toehold:{},tracing:{},treadle:{},trefoil:{},truckle:{},trundle:{},vesture:{},webbing:{},whipsaw:{},wrapper:{},additive:{},adjuvant:{},aperture:{},aquatint:{},backdoor:{},basilisk:{},blowback:{},bludgeon:{},breakage:{},causeway:{},checkout:{},clincher:{},compress:{},corduroy:{},coupling:{},crossbar:{},currency:{},detector:{},dividend:{},dogtooth:{},downcast:{},followup:{},frontage:{},giveaway:{},goodwill:{},hardware:{},headgear:{},headshot:{},hypnotic:{},ignition:{},inhalant:{},lipstick:{},masthead:{},meniscus:{},metallic:{},modeling:{},nautilus:{},neckband:{},nightcap:{},ornament:{},outboard:{},partizan:{},pavement:{},pectoral:{},planking:{},plumbing:{},portable:{},pressing:{},radiator:{},remittal:{},residual:{},resource:{},roulette:{},scaffold:{},scapular:{},scissors:{plural:"scissors"},scrabble:{},springer:{},sunburst:{},tapestry:{},taxation:{},thrasher:{},tomahawk:{},totality:{},tympanum:{},valuable:{},vignette:{},wardrobe:{},widening:{},admixture:{},antiquity:{},aquaplane:{},bagatelle:{},bastinado:{},blindfold:{},blueprint:{},boomerang:{},carpetbag:{},crinoline:{},depressor:{},detergent:{},doodlebug:{},downstage:{},emergency:{},endowment:{},equalizer:{},exemption:{},extortion:{},extractor:{},facsimile:{},freewheel:{},gabardine:{},grotesque:{},hemstitch:{},horseshoe:{},invention:{},jackknife:{},microwave:{},millstone:{},miniature:{},modernism:{},nosepiece:{},ownership:{},packaging:{},pargeting:{},patchwork:{},pinstripe:{},polyester:{},potpourri:{},recording:{},refresher:{},semaphore:{},semblance:{},shielding:{},sideboard:{},skyrocket:{},slapstick:{},soporific:{},spectacle:{},starboard:{},telephone:{},telescope:{},treadmill:{},turntable:{},verdigris:{},videotape:{},whirligig:{},allocation:{},ambulatory:{},anesthetic:{},assistance:{},astringent:{},automation:{},cantilever:{},chinchilla:{},concertina:{},constraint:{},deductible:{},depilatory:{},disposable:{},elongation:{},escutcheon:{},featherbed:{},foreground:{},forfeiture:{},guillotine:{},hammerhead:{},hydroplane:{},innovation:{},intoxicant:{},knockabout:{},lithograph:{},monochrome:{},nonpayment:{},nutcracker:{},pargetting:{},peripheral:{},polychrome:{},redemption:{},stabilizer:{},stenograph:{},subvention:{},sustenance:{},technology:{},television:{},waterspout:{},anaesthetic:{},anamorphism:{},concealment:{},containment:{},copperplate:{},cornerstone:{},counterfeit:{},countersink:{},cryptograph:{},delineation:{},delinquency:{},encumbrance:{},fingerboard:{},fluorescent:{},incumbrance:{},perforation:{},pyrotechnic:{},retribution:{},subsistence:{},tensiometer:{},transporter:{},undercharge:{},withholding:{},dispensation:{},electrolytic:{},encrustation:{},inclinometer:{},incrustation:{},installation:{},intermixture:{},photogravure:{},straightaway:{},transparency:{},appropriation:{},embellishment:{},improvisation:{},merchandising:{},mystification:{},quadruplicate:{},semiautomatic:{},pharmaceutical:{},superannuation:{},aba:{},boa:{},dag:{},fax:{},gad:{},keg:{},nib:{},nog:{},pix:{},pyx:{},rep:{},ski:{},taw:{},urn:{},ante:{},arms:{},bale:{},berm:{},bier:{},bitt:{},bola:{},bolo:{},brad:{},cape:{},cask:{},cent:{},coax:{},coca:{},cosh:{},dime:{},dole:{},doll:{},garb:{},gilt:{},gyro:{},hasp:{},hypo:{},ikon:{},juju:{},lane:{},lint:{},luge:{},lute:{},maxi:{},maze:{},mini:{},mitt:{},mule:{},pail:{},perk:{},plat:{},pork:{},pouf:{},rung:{},scow:{},silk:{},sill:{},skep:{},sled:{},tamp:{},tapa:{},topi:{},trey:{},vape:{},wale:{},wick:{},adobe:{},aegis:{},aglet:{},album:{},alley:{},anode:{},anvil:{},arrow:{},auger:{},batik:{},bogie:{},bolus:{},bongo:{},borer:{},bribe:{},bulla:{},caddy:{},canoe:{},chime:{},coign:{},debit:{},denim:{},depot:{},diary:{},diode:{},drier:{},flask:{},flume:{},fount:{},frier:{},fryer:{},gauze:{},globe:{},golem:{},hijab:{},inlet:{},jimmy:{},jorum:{},kayak:{},khaki:{},lasso:{},latex:{},lisle:{},lorry:{},lucre:{},manta:{},mimeo:{},mizen:{},moire:{},mulch:{},newel:{},nylon:{},penny:{},piste:{},plush:{},poker:{},prism:{},pyxis:{},ranch:{},razor:{},relic:{},rouge:{},ruler:{},sabot:{},scape:{},sedan:{},seine:{},servo:{},shelf:{plural:"shelves"},slops:{},spoke:{},sprig:{},stele:{},steps:{},stoup:{},stove:{},strop:{},suede:{},swage:{},tammy:{},tanka:{},tappa:{},teddy:{},terms:{},toque:{},torus:{},towel:{},tunic:{},tweed:{},usury:{},verso:{},vizor:{},waist:{},winch:{},withe:{},xerox:{},yacht:{},abacus:{},afghan:{},aiglet:{},alidad:{},amends:{},arctic:{},artery:{},avenue:{},banger:{},bangle:{},banian:{},banyan:{},bauble:{},beaker:{},bicorn:{},blazon:{},boiler:{},bracer:{},broach:{},bumper:{},burner:{},buzzer:{},caftan:{},calash:{},camera:{},camion:{},camlet:{},capote:{},carton:{},casein:{},catgut:{},chaise:{},cheque:{},chiton:{},chukka:{},cither:{},cloaca:{},cloche:{},coffer:{},coffin:{},coigne:{},colors:{},corbel:{},corker:{},corset:{},crayon:{},crutch:{},dagger:{},daybed:{},detour:{},diaper:{},dickie:{},dipole:{},dirndl:{},discus:{},dogleg:{},dolman:{},dosage:{},duffel:{},duffle:{},eyecup:{},fabric:{},facade:{},falsie:{},fanjet:{},fascia:{},fetter:{},firkin:{},fizgig:{},floppy:{},frieze:{},garter:{},gimlet:{},goblet:{},guimpe:{},guinea:{},gunnel:{},harrow:{},helmet:{},hookup:{},hotbed:{},impost:{},instep:{},iodine:{},island:{},jersey:{},jetsam:{},jigsaw:{},juicer:{},kaftan:{},kibble:{},kirtle:{},lateen:{},laurel:{},ledger:{},linage:{},lunula:{},magnet:{},markup:{},miotic:{},mizzen:{},myotic:{},nipple:{},nozzle:{},onager:{},pajama:{},pavage:{},pellet:{},pennon:{},peplum:{},peyote:{},pincer:{},pipage:{},pomade:{},pompon:{},popper:{},pyjama:{},ragbag:{},reamer:{},remake:{},reseau:{},rudder:{},russet:{},scythe:{},settee:{},shades:{},shorts:{},siding:{},sleeve:{},sleigh:{},spinet:{},spline:{},stoker:{},stylus:{},sublet:{},subway:{},surtax:{},swathe:{},swivel:{},syrinx:{},taenia:{},talcum:{},tariff:{},teacup:{},teeter:{},tenner:{},tether:{},thwart:{},tocsin:{},trophy:{},trowel:{},turban:{},viewer:{},waggon:{},wampum:{},wherry:{},wicker:{},willow:{},wiring:{},woolen:{},yarder:{},zipper:{},acetate:{},aerosol:{},airline:{},alidade:{},ampulla:{},android:{},aneroid:{},annulet:{},anodyne:{},apanage:{},apparel:{},archive:{},armband:{},armilla:{},arrears:{},banding:{},basting:{},batting:{},bayonet:{},beading:{},bedding:{},bladder:{},blocker:{},blusher:{},bollock:{},bouquet:{},bracing:{},brocade:{},broiler:{},bullion:{},bunting:{},burthen:{},bushing:{},caleche:{},caliper:{},cathode:{},catwalk:{},cautery:{},charger:{},charnel:{},chemise:{},chevron:{},chimney:{},chlamys:{},circlet:{},colours:{},commode:{},cooling:{},cordage:{},coronet:{},corsair:{},crampon:{},cutaway:{},daybook:{},deadeye:{},decoder:{},diagram:{},doeskin:{},dogsled:{},doormat:{},dragger:{},dragnet:{},drapery:{},drawers:{},dustpan:{},escheat:{},eyehole:{},fixings:{},flatbed:{},flattop:{},flipper:{},foghorn:{},foliage:{},footage:{},foretop:{},forgery:{},frigate:{},funding:{},furring:{},fustian:{},garment:{},garotte:{},garrote:{},gouache:{},grapnel:{},griddle:{},hackney:{},hammock:{},harpoon:{},hassock:{},hatchel:{},hatchet:{},heating:{},hedging:{},hibachi:{},hobnail:{},holding:{},holster:{},hydrant:{},iceboat:{},igniter:{},impasse:{},ironing:{},jackpot:{},javelin:{},joinery:{},fibre:{},hazel:{},lemon:{},peach:{},plank:{},raven:{},snipe:{},spine:{},steer:{},stint:{},stunt:{},bleach:{},breath:{},callus:{},cherry:{},dimple:{},entire:{},ferret:{},filler:{},hybrid:{},jackal:{},marrow:{},orange:{},radish:{},spruce:{},stifle:{},winkle:{},endemic:{},vanilla:{},beefwood:{},calabash:{},concrete:{},emission:{},kingfish:{},solution:{},volatile:{},partridge:{},repellant:{},derivative:{},thickening:{},ash:{},bud:{},cob:{},hen:{},mew:{},mud:{},mum:{},paw:{},roe:{},sow:{},soy:{},wax:{},yam:{},beef:{},burl:{},calf:{plural:"calves"},chat:{},fowl:{},fuzz:{},gill:{},grub:{},hock:{},hoof:{},lobe:{},rose:{},scup:{},soup:{},swan:{},tint:{},tuna:{},tusk:{},alloy:{},briar:{},clove:{},coney:{},ebony:{},ether:{},filth:{},flesh:{},gumbo:{},homer:{},jelly:{},matte:{},mocha:{},reeve:{},wrack:{},annual:{},canine:{},carrot:{},cereal:{},cockle:{},feeler:{},fennel:{},flimsy:{},gargle:{},gravel:{},grouse:{},indigo:{},mammee:{},medlar:{},monkey:{},nebula:{},oyster:{},salmon:{plural:"salmon"},shiner:{},shrimp:{},sprout:{},stigma:{},blossom:{},blubber:{},buffalo:{},cabbage:{},calamus:{},catfish:{},caudate:{},caustic:{},chelate:{},chicory:{},ciliate:{},essence:{},griffon:{},hemlock:{},hydrate:{},incense:{},lighter:{},remount:{},sardine:{},stinger:{},vitriol:{},ambrosia:{},billfish:{},blackcap:{},crawfish:{},crayfish:{},earthnut:{},escallop:{},filament:{},flounder:{},infusion:{},ironwood:{},quandong:{},relative:{},ringtail:{},screamer:{},sycamore:{},alabaster:{},algarroba:{},broadbill:{},composite:{},fulminate:{},perennial:{},tangerine:{},bladderpod:{},granadilla:{},heartsease:{},periwinkle:{},tumbleweed:{},agglomerate:{},bittersweet:{},intermediate:{},dye:{},elk:{},fig:{},haw:{},oka:{},pea:{},pee:{},rye:{},sac:{},tar:{},yak:{},carp:{},clay:{},coma:{},cony:{},crud:{},cusk:{},dung:{},fang:{},foam:{},germ:{},glue:{},hare:{},hind:{},husk:{},kiwi:{},lake:{},mung:{},okra:{},pine:{},pith:{},puke:{},rice:{},roan:{},sloe:{},taro:{},teal:{},yellow:{},titi:{},twig:{},amber:{},anime:{},berry:{},boxer:{},carob:{},cedar:{},chine:{},guava:{},hound:{},husky:{},kauri:{},lemma:{},monad:{},ocher:{},ochre:{},onion:{},ounce:{},pansy:{},pecan:{},pewit:{},prawn:{},quail:{},shuck:{},sloth:{},slush:{},smelt:{},snail:{},snout:{},spawn:{},swift:{},tabby:{},thorn:{},topaz:{},umber:{},virus:{},wafer:{},wahoo:{},wheat:{},whelk:{},badger:{},bonito:{},broody:{},chrome:{},cirrus:{},cocoon:{},cowpea:{},cuckoo:{},elixir:{},grease:{},grubby:{},howler:{},jabiru:{},jargon:{},jujube:{},kernel:{},leaven:{},lentil:{},liquor:{},locust:{},manioc:{},mastic:{},mentum:{},mildew:{},mimosa:{},mullet:{},muscat:{},mutant:{},nectar:{},nettle:{},nodule:{},pawpaw:{},pecker:{},plasma:{},ruddle:{},sallow:{},shoddy:{},squill:{},starch:{},stroma:{},stucco:{},sunray:{},thorax:{},tissue:{},violet:{},walnut:{},warble:{},amyloid:{},antenna:{plural:"antennae"},apricot:{},aquatic:{},terrestrial:{},asphalt:{},avocado:{},beebalm:{},bobtail:{},builder:{},bulldog:{},caltrop:{},cayenne:{},chinook:{},coconut:{},cricket:{},cudweed:{},currant:{},cuticle:{},dasheen:{},gallfly:{},juniper:{},lacquer:{},leaflet:{},lettuce:{},macadam:{},mordant:{},mustard:{},packing:{},panther:{},papilla:{},papyrus:{},parsnip:{},pigweed:{},pollard:{},redfish:{},redwood:{},rubbish:{},saffron:{},salsify:{},shallot:{},slating:{},solvate:{},solvent:{},soybean:{},sunfish:{},truffle:{},whisker:{},abrasive:{},allspice:{},angelica:{},biennial:{},bilberry:{},bluebell:{},chickpea:{},cinnabar:{},cinnamon:{},congener:{},creosote:{},demerara:{},duckbill:{},firebird:{},fleabane:{},humanity:{},lavender:{},mahogany:{},monkfish:{},paraffin:{},peduncle:{},peroxide:{},plantain:{},rockfish:{},sandarac:{},sandwort:{},scammony:{},shamrock:{},skipjack:{},skullcap:{},snowbird:{},suckling:{},tubercle:{},alligator:{},angelfish:{},arachnoid:{},arrowroot:{},bearberry:{},blackfish:{},buckthorn:{},capitulum:{},carbonate:{},carnation:{},celluloid:{},chemistry:{},coriander:{},corrosive:{},crabapple:{},devilfish:{},emanation:{},groundnut:{},horseback:{},horsemint:{},injection:{},matchwood:{},mistletoe:{},offspring:{plural:"offspring"},pyrethrum:{},raspberry:{},razorback:{},satinwood:{},sheepskin:{},tomatillo:{},waxflower:{},whitefish:{},ammunition:{},bitterwood:{},blackberry:{},butterfish:{},chinquapin:{},coneflower:{},flagellate:{},flamboyant:{},fledgeling:{},insulation:{},peppermint:{},receptacle:{},strawberry:{},watercress:{},chittamwood:{},everlasting:{},fomentation:{},helleborine:{},honeysuckle:{},horseradish:{},huckleberry:{},salmonberry:{},shittimwood:{},strawflower:{},ultramarine:{},whitethroat:{},wintergreen:{},helmetflower:{},impregnation:{},quintessence:{},sternutatory:{},thimbleberry:{},contamination:{},extravasation:{},leatherjacket:{},pulverisation:{},pulverization:{},tortoiseshell:{},ti:{},ala:{},asp:{},eel:{},elm:{},fir:{},gar:{},neb:{},nit:{},oak:{},oat:{},sol:{},tom:{},yew:{},agar:{},akee:{},anil:{},atom:{},balm:{},bast:{},beet:{},boar:{},bole:{},bran:{},brit:{},cere:{},cero:{},chow:{},coho:{},dahl:{},dill:{},flax:{},foal:{},glop:{},gnat:{},hake:{},herb:{},hoar:{},homo:{},kaki:{},kino:{},leek:{},loin:{},mite:{},musk:{},parr:{},pear:{},poon:{},puka:{},rhea:{},saki:{},seta:{},shad:{},silt:{},slag:{},soda:{},soma:{},soot:{},soya:{},talc:{},teak:{},tufa:{},unai:{},unau:{},whey:{},woad:{},wort:{},yolk:{},zinc:{},abaca:{},alder:{},alula:{},amino:{},anise:{},apple:{},aroid:{},aster:{},balsa:{},basil:{},beech:{},betel:{},biddy:{},billy:{},biped:{},booby:{},britt:{},bruin:{},cairn:{},capon:{},caulk:{},chard:{},chess:{},chick:{},cisco:{},cohoe:{},comma:{},croup:{},cumin:{},dross:{},elver:{},epoxy:{},ergot:{},falls:{},flint:{},fossa:{},genip:{},grout:{},grume:{},henna:{},hilum:{},humus:{},hydra:{},icaco:{},ilama:{},imago:{},ivory:{},kapok:{},kenaf:{},lapin:{},larch:{},lilac:{},lotus:{},luffa:{},mahoe:{},maize:{},mamey:{},mango:{},manna:{},melon:{},moong:{},naiad:{},nanny:{},nopal:{},orris:{},osier:{},otter:{},ovary:{},ovule:{},pacer:{},panda:{},papaw:{},piggy:{},pilus:{},pinna:{},pixie:{},polyp:{},potto:{},putty:{},quira:{},robin:{},roble:{},rosin:{},scrod:{},sepia:{},sisal:{},slime:{},sorus:{},sprat:{},squid:{},stoma:{},sumac:{},swede:{},theca:{},thyme:{},trout:{plural:"trout"},tunny:{},vapor:{},velum:{},venom:{},vinyl:{},whelp:{},yeast:{},acetum:{},acinus:{},acumen:{},adduct:{},agaric:{},alkali:{},almond:{},anuran:{},archil:{},argent:{},balata:{},bamboo:{},bantam:{},barley:{},basset:{},beluga:{},bennet:{},bluing:{},bonduc:{},borage:{},capsid:{},cashew:{},cassia:{},caudex:{},celery:{},chives:{},cilium:{},citron:{},cobnut:{},cocker:{},cosmos:{},cowage:{},croton:{},cupule:{},cushaw:{},darter:{},dentin:{},dobson:{},dodder:{},donkey:{},durian:{},embryo:{},endive:{},ermine:{},falcon:{},feijoa:{},feline:{},fisher:{},fucoid:{},gadfly:{},garlic:{},glycol:{},hackle:{},haunch:{},herpes:{},hyssop:{},kaffir:{},kitten:{},lichee:{},limpet:{},linden:{},linnet:{},litchi:{},loofah:{},loquat:{},lovage:{},lupine:{},madder:{},maguey:{},manure:{},marang:{},mescal:{},mocker:{},mombin:{},mucoid:{},mudcat:{},munggo:{},murine:{},mussel:{},myrtle:{},nipper:{},nutmeg:{},obeche:{},orchil:{},orchis:{},oriole:{},padauk:{},paigle:{},papaya:{},parget:{},pasang:{},peewee:{},peewit:{},phenol:{},plaice:{},pomelo:{},poplar:{},possum:{},potato:{},pothos:{},pouter:{},puffer:{},pullet:{},pumice:{},pyrene:{},quahog:{},quartz:{},quince:{},rachis:{},raffia:{},ratter:{},relict:{},sabicu:{},saline:{},sapote:{},saurel:{},schrod:{},senega:{},septum:{},setter:{},sierra:{},simian:{},sludge:{},solder:{},spirea:{},stevia:{},sulfur:{},thrift:{},toetoe:{},tomato:{},tophus:{},triton:{},tupelo:{},turbot:{},turnip:{},vapour:{},vellum:{},wapiti:{},wasabi:{},acerola:{},actinon:{},aculeus:{},adamant:{},albumen:{},alewife:{},alfalfa:{},amboyna:{},anchovy:{},anemone:{},anionic:{},annelid:{},annulus:{},antacid:{},antlion:{},arsenic:{},aurochs:{},babbitt:{},barilla:{},beeswax:{},bimetal:{},biomass:{},bloomer:{},blotter:{},bluefin:{},blueing:{},boneset:{},boxwood:{},bracken:{},brocket:{},bromide:{},buckeye:{},bugbane:{},bugloss:{},bullock:{},bulrush:{},buzzard:{},cackler:{},cacodyl:{},caliche:{},calycle:{},cambium:{},capulin:{},caraway:{},cardoon:{},catbird:{},catechu:{},celtuce:{},ceriman:{},chalaza:{},chamois:{},chervil:{},chigger:{},citrate:{},cocoyam:{},codfish:{},comfrey:{},compost:{},cowslip:{},crappie:{},crawdad:{},crinoid:{},cyanide:{},cypress:{},dabbler:{},denizen:{},diploid:{},dogfish:{},dogwood:{},echidna:{},eelpout:{},enation:{},fallout:{},ferrite:{},fetlock:{},filaria:{},filbert:{},firebug:{},firefly:{},frijole:{},fuchsia:{},gamboge:{},ginseng:{},girasol:{},glutton:{},gobbler:{},grackle:{},grampus:{},granite:{},grizzly:{},grouper:{},grunter:{},gudgeon:{},haddock:{},halibut:{},haploid:{},haricot:{},heather:{},hepatic:{},herring:{},hickory:{},hogfish:{},honesty:{},hyaline:{},ignitor:{},inducer:{},jackass:{},jewfish:{},jonquil:{},kestrel:{},kingcup:{},kumquat:{},lactate:{},langsat:{},lanolin:{},lingcod:{},lobster:{},logwood:{},mahagua:{},majagua:{},malacca:{},mammoth:{},marabou:{},marasca:{},menthol:{},mercury:{},monarch:{},moneran:{},mongrel:{},moorhen:{},morello:{},muskrat:{},nervure:{},nitrate:{},octopus:{},oldwife:{},opossum:{},oregano:{},ostrich:{},oxheart:{},parsley:{},peacock:{},pigfish:{},pimento:{},piranha:{},plumcot:{},pollack:{},pollock:{},pompano:{},popcorn:{},poultry:{},pricket:{},puccoon:{},pulasan:{},pyrogen:{},quahaug:{},quassia:{},quetzal:{},raccoon:{},ragweed:{},ragwort:{},rattler:{},redbird:{},redpoll:{},redtail:{},reducer:{},redwing:{},remover:{},residue:{},retinal:{},rhubarb:{},rosebud:{},rostrum:{},satsuma:{},saurian:{},sequoia:{},seriema:{},skylark:{},sockeye:{},soursop:{},sparrow:{},spinach:{},spiraea:{},stentor:{},steroid:{},stubble:{},sulfate:{},sulphur:{},tangelo:{},taproot:{},tarweed:{},tarwood:{},tattler:{},taurine:{},teargas:{},timothy:{},tobacco:{},topknot:{},tortrix:{},trotter:{},varmint:{},verdure:{},viceroy:{},vinegar:{},viscose:{},vulture:{},walleye:{},waratah:{},warbler:{},waxwork:{},whooper:{},wilding:{},witloof:{},wryneck:{},abradant:{},absinthe:{},acceptor:{},actinoid:{},adhesive:{},adjutant:{},ageratum:{},agueweed:{},albacore:{},amarelle:{},amethyst:{},ammoniac:{},argonaut:{},armyworm:{},auricula:{},balancer:{},baldpate:{},barnacle:{},basswood:{},bayberry:{},bearskin:{},beetroot:{},birdlime:{},blackfly:{},blacktop:{},bluebird:{},bluefish:{},boarfish:{},bocconia:{},boxberry:{},brisling:{},broccoli:{},buckskin:{},bullhead:{},bullrush:{},canistel:{},capuchin:{},carangid:{},carbonyl:{},carboxyl:{},cardamom:{},cardamon:{},carinate:{},carnauba:{},carotene:{},cashmere:{},catalyst:{},catchfly:{},celeriac:{},cetacean:{},chimaera:{},chloride:{},cilantro:{},cinchona:{},citrange:{},cockspur:{},conodont:{},costmary:{},cowberry:{},cucumber:{},deadwood:{},detritus:{},dewberry:{},dilution:{},dolomite:{},duckling:{},ectozoan:{},eelgrass:{},effluent:{},eggplant:{},emulsion:{},estragon:{},filtrate:{},fireweed:{},flathead:{},flooring:{},forelock:{},galangal:{},garbanzo:{},grayback:{},guaiacum:{},hardtack:{},harebell:{},hawkweed:{},hazelnut:{},hedgehog:{},hepatica:{},hookworm:{},hornwort:{},horsefly:{},hyacinth:{},impurity:{},iodoform:{},jalapeno:{},jamberry:{},japonica:{},keurboom:{},kindling:{},kingwood:{},kinkajou:{},kohlrabi:{},labdanum:{},lambskin:{},locoweed:{},lovebird:{},magnolia:{},mahimahi:{},mandrake:{},margarin:{},marjoram:{},medusoid:{},mephitis:{},migrator:{},molecule:{},moonfish:{},mucilage:{},mulberry:{},nestling:{},omnivore:{},ovenbird:{},pandanus:{},pickerel:{},pilchard:{},pimiento:{},pitahaya:{},placenta:{},plumbago:{},predator:{},ptomaine:{},puffball:{},pulassan:{},purebred:{},pyrectic:{},quandang:{},quickset:{},rambotan:{},rambutan:{},redberry:{},redstart:{},reedbird:{},ricebird:{},richweed:{},ringdove:{},rockrose:{},rosefish:{},rosemary:{},rosewood:{},ruminant:{},rutabaga:{},sailfish:{},salsilla:{},saltwort:{},sandfish:{},scallion:{},seahorse:{},sealskin:{},sewerage:{},shoveler:{},siderite:{},silkworm:{},sparling:{},squealer:{},squirrel:{},stearate:{},stinkpot:{},superbug:{},surffish:{},sweetsop:{},tamarind:{},tarragon:{},teaberry:{},thresher:{},throstle:{},tilefish:{},tomentum:{},toxicant:{},turmeric:{},ungulate:{},univalve:{},urochord:{},vesicant:{},warragal:{},warrigal:{},watchdog:{},waxberry:{},weakfish:{},wolffish:{},woodbine:{},woodruff:{},wormcast:{},wriggler:{},zucchini:{},absorbent:{},adsorbate:{},adsorbent:{},albatross:{},almandine:{},andromeda:{},antiknock:{},apophysis:{},archangel:{},arsenical:{},artichoke:{},asparagus:{},aubergine:{},bacteroid:{},blackbird:{},blindworm:{},bluegrass:{},bluepoint:{},broadtail:{},brooklime:{},brookweed:{},brushwood:{},buckwheat:{},bugleweed:{},buteonine:{},butternut:{},caecilian:{},calyculus:{},candlenut:{},cantaloup:{},carambola:{},carbonado:{},carbuncle:{},cardboard:{},carnivore:{},catamount:{},celandine:{},chameleon:{},chatterer:{},chelonian:{},cherimoya:{},chickweed:{},chlamydia:{},clamshell:{},clapboard:{},coachwhip:{},cochineal:{},cocklebur:{},cocozelle:{},coltsfoot:{},commensal:{},courgette:{},crackling:{},cupflower:{},cyanamide:{},digestive:{},digitalis:{},driftfish:{},ecrevisse:{},ectoplasm:{},eiderdown:{},ephemeral:{},eutherian:{},evergreen:{},excretion:{},exudation:{},fenugreek:{},firebrand:{},firestone:{},flagellum:{},frostweed:{},funiculus:{},gladiolus:{},glasswort:{},goldeneye:{},goldfinch:{},grapevine:{},grenadier:{},hackberry:{},hamadryad:{},heartleaf:{},hellebore:{},hollyhock:{},horehound:{},horsebean:{},horsehair:{},horseweed:{},hortensia:{},hydroxide:{},jackfruit:{},jacksnipe:{},jellyfish:{},juneberry:{},lancewood:{},langouste:{},leavening:{},lemonwood:{},mammalian:{},manzanita:{},maravilla:{},marihuana:{},marijuana:{},moosewood:{},muscadine:{},muskmelon:{},nakedwood:{},nectarine:{},nighthawk:{},pasturage:{},patchouli:{},patchouly:{},pelecypod:{},pellitory:{},peregrine:{},peristome:{},persimmon:{},phosphate:{},pimpernel:{},pinchbeck:{},pineapple:{},pistachio:{},polyploid:{},probiotic:{},proboscis:{},protozoan:{},pureblood:{},quadruped:{},rauwolfia:{},recycling:{},reptilian:{},reticulum:{},rockcress:{},rootstock:{},rosinweed:{},sandpaper:{},sapodilla:{},sassafras:{},sheldrake:{},shingling:{},shoveller:{},siccative:{},sicklepod:{},snakeroot:{},snowflake:{},sourdough:{},spicebush:{},spirillum:{},stainless:{},stiffener:{},strangler:{},strawworm:{},sugarcane:{},swordfish:{},tamarindo:{},tarantula:{},topminnow:{},tulipwood:{},turquoise:{},twayblade:{},twinberry:{},wallpaper:{},whitebait:{},whiteface:{},wineberry:{},wolverine:{},workhorse:{},adulterant:{},amygdaloid:{},anopheline:{},aquamarine:{},belladonna:{},bellwether:{},bitterweed:{},blacksnake:{},blackthorn:{},bluebonnet:{},bluebottle:{},bottlenose:{},brachiopod:{},brazilwood:{},breadfruit:{},butterball:{},butterweed:{},candelilla:{},cantaloupe:{},catarrhine:{},cellulosic:{},chatterbox:{},chinaberry:{},cinquefoil:{},citronwood:{},clementine:{},condensate:{},copperhead:{},coralberry:{},cornflower:{},cottonweed:{},cottonwood:{},crossbreed:{},crustacean:{},deathwatch:{},demoiselle:{},dollarfish:{},elderberry:{},exhalation:{},feathertop:{},fetterbush:{},fiddlehead:{},flycatcher:{},fritillary:{},garambulla:{},goldenbush:{},gooseberry:{},grapefruit:{},jaboticaba:{},jackrabbit:{},ketembilla:{},kitembilla:{},lemongrass:{},littleneck:{},loganberry:{},loggerhead:{},mangosteen:{},marblewood:{},marguerite:{},massasauga:{},meerschaum:{},monoclonal:{},nasturtium:{},needlefish:{},nonstarter:{},ornamental:{},pacesetter:{},parenchyma:{},pennyroyal:{},pepperwort:{},plasmodium:{},princewood:{},propellant:{},propellent:{},pufferfish:{},pyrimidine:{},quercitron:{},restharrow:{},restrainer:{},ribbonfish:{},ribbonwood:{},rudderfish:{},sapphirine:{},scorzonera:{},sidewinder:{},silverbush:{},silverfish:{},silverweed:{},spiceberry:{},sticktight:{},sugarberry:{},superoxide:{},tarmacadam:{},turpentine:{},turtledove:{},velvetleaf:{},vertebrate:{},vesicatory:{},wandflower:{},watermelon:{},windowpane:{},witchgrass:{},yellowbird:{},yellowtail:{},yellowwood:{},adulterator:{},arthrospore:{},artiodactyl:{},bactericide:{},boysenberry:{},branchiopod:{},buffalofish:{},butcherbird:{},cauliflower:{},cherrystone:{},chittimwood:{},chokecherry:{},combustible:{},conspecific:{},digitigrade:{},dolphinfish:{},flameflower:{},gillyflower:{},groundberry:{},groundcover:{},heterocycle:{},honeyflower:{},insectivore:{},leatherleaf:{},leatherwood:{},lingonberry:{},liquidambar:{},loosestrife:{},muskellunge:{},plantigrade:{},platyrrhine:{},pomegranate:{},precipitant:{},prickleback:{},quicksilver:{},recombinant:{},refrigerant:{},shellflower:{},silversides:{},sleuthhound:{},swallowwort:{},unguiculate:{},waldmeister:{},archosaurian:{},distillation:{},heterocyclic:{},honeycreeper:{},instillation:{},invertebrate:{},nonsteroidal:{},placentation:{},sarsaparilla:{},serviceberry:{},squirrelfish:{},transudation:{},weatherboard:{},whortleberry:{},yellowhammer:{},branchiopodan:{},inflorescence:{},platyrrhinian:{},semiconductor:{},transactinide:{},vitrification:{},fructification:{},aa:{},ai:{},ani:{},auk:{},awn:{},bot:{},dak:{},daw:{},dew:{},doe:{},dug:{},eft:{},ern:{},ewe:{},gib:{},gnu:{},goo:{},ivy:{},jay:{},kea:{},kob:{},lac:{},lye:{},may:{},mei:{},moa:{},oca:{},ola:{},olm:{},pia:{},pug:{},teg:{},tup:{},acyl:{},agua:{},aloe:{},amyl:{},anoa:{},apar:{},aril:{},arui:{},atar:{},axil:{},barm:{},baya:{},bine:{},boll:{},bufo:{},buna:{},calx:{},cavy:{},chub:{},cleg:{},coco:{},colt:{},coot:{},corm:{},cows:{},craw:{},culm:{},cyme:{},dace:{},dalo:{},deer:{plural:"deer"},derv:{},dhak:{},dhal:{},dika:{},diol:{},disa:{},dita:{},dogy:{},doob:{},dopa:{},enol:{},erne:{},eyas:{},fern:{},fice:{},floc:{},fuji:{},gean:{},goby:{},guan:{},guar:{},guib:{},haem:{},halm:{},hart:{},heme:{},hogg:{},hops:{},hoya:{},ibex:{},ibis:{},inga:{},jird:{},jute:{},kali:{},kelp:{},kola:{},kudu:{},lily:{},lino:{},liza:{},loam:{},loir:{},lory:{},lynx:{},mako:{},mamo:{},mara:{},marl:{},merl:{},mica:{},milo:{},miro:{},mola:{},moss:{},munj:{},mutt:{},myna:{},nagi:{},napa:{},napu:{},neem:{},neon:{},olla:{},ombu:{},onyx:{},opah:{},opal:{},orca:{},oryx:{},paca:{},peat:{},peba:{},pika:{},pome:{},puku:{},puma:{},pupa:{},ragi:{},rimu:{},rudd:{},sago:{},salp:{},sang:{},sard:{},scut:{},sial:{},sika:{},sild:{},sima:{},skua:{},smew:{},sugi:{},tatu:{},teff:{},teju:{},tern:{},tipu:{},toad:{},tody:{},tolu:{},tuff:{},tung:{},urea:{},urus:{},vole:{},wasp:{},weka:{},blast:{},dinar:{},lapse:{},lurch:{},whirl:{},travel:{},capacity:{},encounter:{},conversion:{},separation:{},age:{},nip:{},now:{},halt:{},leap:{},mile:{},peak:{},peso:{},slam:{},term:{},wake:{},faint:{},scoop:{},surge:{},third:{},trick:{},bother:{},cackle:{},motion:{},chatter:{},reversal:{},elevation:{},experience:{},dab:{},pat:{},cube:{},howl:{},over:{},peep:{},span:{},cause:{},death:{},plump:{},plunk:{},poise:{},pulse:{},shame:{},spark:{},twang:{},wound:{},cipher:{},crunch:{},damage:{},fusion:{},period:{},racket:{},repeat:{},supply:{},wallow:{},wonder:{},dribble:{},failure:{},outrage:{},sparkle:{},backfire:{},campaign:{},delivery:{},increase:{},variance:{},explosion:{},correction:{},disturbance:{},translation:{},displacement:{},transposition:{},hum:{},mug:{},buzz:{},cord:{},dawn:{},fuss:{},hint:{},hiss:{},much:{},past:{},ping:{},rout:{},seek:{},tide:{},warp:{},birth:{},blend:{},crumb:{},delay:{},rupee:{},worst:{},climax:{},deluge:{},dirham:{},recoil:{},replay:{},rhythm:{},rising:{},descent:{},grumble:{},impulse:{},respite:{},scruple:{},triumph:{},addition:{},dogfight:{},eruption:{},occasion:{},progress:{},reprieve:{},shilling:{},stampede:{},accretion:{},induction:{},appearance:{},suggestion:{},circulation:{},irradiation:{},accommodation:{},precipitation:{},in:{},ebb:{},mil:{},zap:{},gush:{},honk:{},lull:{},plop:{},rave:{},ream:{},slap:{},then:{},zoom:{},fifth:{},final:{},gleam:{},reign:{},swash:{},throb:{},thump:{},tweet:{},wreck:{},wring:{},billow:{},breach:{},ending:{},fourth:{},gurgle:{},injury:{},nibble:{},parity:{},sunset:{},billion:{},history:{},instant:{},spatter:{},blackout:{},creation:{},decision:{},downhill:{},entrance:{},rational:{},trillion:{},hereafter:{},immersion:{},intrusion:{},millenary:{},remainder:{},saltation:{},adjustment:{},antecedent:{},dedication:{},deflection:{},impairment:{},limitation:{},outpouring:{},refinement:{},scattering:{},devastation:{},elaboration:{},fundamental:{},prohibition:{},retardation:{},interference:{},transmission:{},manifestation:{},scintillation:{},mi:{},kip:{},wee:{},yaw:{},bout:{},bray:{},doom:{},harm:{},haul:{},jolt:{},none:{},ooze:{},pity:{},sigh:{},surf:{},thaw:{},tour:{},alpha:{},carom:{},chunk:{},clink:{},colon:{},deuce:{},drama:{},glint:{},going:{},shtik:{},sixth:{},spurt:{},thrum:{},tinge:{},today:{},waltz:{},worth:{},bucket:{},egress:{},fathom:{},mutter:{},patter:{},picnic:{},quaver:{},ripple:{},rustle:{},shtick:{},sizzle:{},squawk:{},stride:{},tremor:{},whoosh:{},wobble:{},absence:{},allegro:{},andante:{},deficit:{},episode:{},heaving:{},raising:{},rebirth:{},roaring:{},rupture:{},screech:{},scrunch:{},seventh:{},success:{},sunrise:{},takeoff:{},trample:{},twinkle:{},cracking:{},deletion:{},incident:{},interval:{},isometry:{},overflow:{},rattling:{},skeleton:{},splatter:{},striking:{},twilight:{},upheaval:{},advantage:{},alignment:{},deflexion:{},diffusion:{},emergence:{},inflation:{},normality:{},remission:{},resultant:{},ruination:{},shakedown:{},vibration:{},yesterday:{},allegretto:{},conception:{},concoction:{},concretion:{},disruption:{},divergence:{},graduation:{},inflection:{},initiation:{},moderation:{},sprinkling:{},approaching:{},biquadratic:{},competition:{},compression:{},contraction:{},humiliation:{},permutation:{},constriction:{},ramification:{},accompaniment:{},embarrassment:{},mortification:{},rectification:{},coo:{},eve:{},gee:{},par:{},sea:{},sec:{},tot:{},won:{},yen:{},bash:{},beep:{},ding:{},dram:{},fete:{},gait:{},inch:{},lira:{},peal:{},pint:{},purr:{},rial:{},ting:{},toot:{},whiz:{},blare:{},bleat:{},brawl:{},cease:{},digit:{},dying:{},epoch:{},gravy:{},idyll:{},knell:{},metre:{},minim:{},ninth:{},plash:{},plonk:{},quake:{},quart:{},ravel:{},salvo:{},skirl:{},snore:{},spate:{},spirt:{},swish:{},tenth:{},unity:{},whack:{},whirr:{},years:{},ascent:{},bushel:{},curfew:{},drachm:{},eighth:{},enough:{},finale:{},fizzle:{},footer:{},gobble:{},jingle:{},marvel:{},myriad:{},octave:{},ravage:{},smudge:{},spritz:{},squeak:{},squeal:{},squish:{},swerve:{},tierce:{},usance:{},waxing:{},atrophy:{},banging:{},bending:{},blowout:{},centner:{},clangor:{},debacle:{},decimal:{},eclipse:{},glitter:{},kickoff:{},midterm:{},million:{},misfire:{},modulus:{},monsoon:{},ordinal:{},outflow:{},ringing:{},shimmer:{},sinking:{},smolder:{},torrent:{},twelfth:{},backwash:{},bouncing:{},downfall:{},dripping:{},drumbeat:{},eighties:{},eternity:{},exigency:{},footstep:{},furlough:{},gleaming:{},grinding:{},hardship:{},instance:{},invasion:{},majority:{},maturity:{},nineties:{},overtime:{},overture:{},pandemic:{},pounding:{},receding:{},recovery:{},rustling:{},scraping:{},sixtieth:{},smoulder:{},spoilage:{},spraying:{},tomorrow:{},touching:{},amplitude:{},ascension:{},athletics:{},avalanche:{},billionth:{},checkmate:{},clearance:{},collision:{},commotion:{},contagion:{},departure:{},fertility:{},formality:{},gestation:{},heartbeat:{},honeymoon:{},hundredth:{},interlude:{},irruption:{},lactation:{},millionth:{},multitude:{},onslaught:{},outgrowth:{},plurality:{},probation:{},pulsation:{},shrinkage:{},sixteenth:{},spreading:{},stalemate:{},throbbing:{},whistling:{},withering:{},affliction:{},alteration:{},betterment:{},dispersion:{},enervation:{},expiration:{},foreboding:{},incubation:{},incumbency:{},inevitable:{},irrational:{},jubilation:{},levitation:{},millennium:{plural:"millennia"},procession:{},repetition:{},revolution:{},sabbatical:{},solubility:{},subsidence:{},thousandth:{},undulation:{},visitation:{},accelerando:{},catastrophe:{},celebration:{},coincidence:{},consequence:{},continuance:{},deformation:{},dislocation:{},dissipation:{},expansivity:{},fluctuation:{},gravitation:{},oscillation:{},preliminary:{},punctuation:{},sufficiency:{},acceleration:{},augmentation:{},championship:{},commencement:{},conservation:{},deceleration:{},degeneration:{},encroachment:{},interlocking:{},reflectivity:{},consolidation:{},hundredweight:{},magnetisation:{},magnetization:{},regurgitation:{},sheepshearing:{},transmutation:{},conglomeration:{},materialisation:{},optic:{},patty:{},prune:{},saute:{},scalp:{},sinus:{},swill:{},bubbly:{},burgoo:{},choler:{},claret:{},cortex:{},crotch:{},drivel:{},frappe:{},hiatus:{},kosher:{},legume:{},macula:{},phlegm:{},pickle:{},stemma:{},thenar:{},tiptoe:{},adrenal:{},anatomy:{},confect:{},freckle:{},jugular:{},knuckle:{},mastoid:{},medulla:{},pudding:{},takeout:{},thyroid:{},tonsure:{},wassail:{},anterior:{},coloring:{},julienne:{},libation:{},rhomboid:{},sandwich:{},takeaway:{},appendage:{},chocolate:{},colouring:{},endocrine:{},hamstring:{},moonshine:{},permanent:{},recessive:{},turbinate:{},confection:{},hemisphere:{},ingredient:{},spatchcock:{},sweetening:{},convolution:{},pneumogastric:{},os:{},cos:{},cud:{},sup:{},caul:{},chaw:{},chin:{},chou:{},curd:{},cyst:{},fizz:{},jowl:{},mane:{},milt:{},perm:{},snot:{},sorb:{},sura:{},taco:{},booze:{},broth:{},caput:{},chili:{},cocoa:{},costa:{},cress:{},dough:{},eater:{},fanny:{},fondu:{},hyoid:{},loins:{},lolly:{},lumen:{},mamma:{},mummy:{},pasta:{},plasm:{},porgy:{},puree:{},quaff:{},quark:{},sinew:{},thigh:{},tripe:{},tummy:{},areola:{},banana:{},booger:{},bowleg:{},brunch:{},carpal:{},cervix:{},citrus:{},comfit:{},dactyl:{},dorsum:{},edible:{},flitch:{},fondue:{},fornix:{},gammon:{},herbal:{},lambda:{},malted:{},marcel:{},millet:{},monggo:{},noodle:{},paring:{},pastry:{},pelvis:{},simnel:{},spleen:{},tarsal:{},tensor:{},tipple:{},waffle:{},wonton:{},abdomen:{},adenoid:{},auricle:{},biscuit:{},brownie:{},clabber:{},criollo:{},croaker:{},cubitus:{},deltoid:{},dentine:{},dietary:{},eyeball:{},fistula:{},forearm:{},fritter:{},gherkin:{},haircut:{},headful:{},hyaloid:{},iceberg:{},isthmus:{},kneecap:{},lacteal:{},lasagna:{},lasagne:{},lozenge:{},marmite:{},midriff:{},oatmeal:{},ocellus:{},pageboy:{},paprika:{},pathway:{},pottage:{},prepuce:{},pumpkin:{},ramekin:{},ratafia:{},roulade:{},sausage:{},seltzer:{},serving:{},sidecar:{},slobber:{},sorghum:{},stirrup:{},sultana:{},teacake:{},timbale:{},toenail:{},topping:{},tostada:{},trachea:{},treacle:{},twister:{},vintage:{},abducent:{},abductor:{},afferent:{},alveolus:{},appendix:{plural:"appendices"},astragal:{},bicuspid:{},blowfish:{},blowhole:{},bouffant:{},capitate:{},chowchow:{},cobblers:{},cocktail:{},coquille:{},couscous:{},doughboy:{},doughnut:{},dumpling:{},efferent:{},eminence:{},exocrine:{},fascicle:{},flatfish:{},flatfoot:{},flummery:{},forehead:{},foreskin:{},hairline:{},honeydew:{},licorice:{},ligament:{},lollipop:{},macaroni:{},mackerel:{},marinade:{},membrane:{},monstera:{},mouthful:{},muscatel:{},pheasant:{},physique:{},potation:{},prostate:{},ramequin:{},receptor:{},sillabub:{},sinusoid:{},smoothie:{},specimen:{},streusel:{},stuffing:{},syllabub:{},teardrop:{},venation:{},windfall:{},abdominal:{},apparatus:{},blueberry:{},casserole:{},corpuscle:{},cranberry:{},demitasse:{},dentition:{},drinkable:{},drumstick:{},epiphysis:{},flageolet:{},fricassee:{},hamburger:{},labyrinth:{},lifeblood:{},lineament:{},liquorice:{},mastoidal:{},maxillary:{},navicular:{},pituitary:{},pompadour:{},provender:{},purulence:{},shellfish:{},spaghetti:{},spareribs:{},splayfoot:{},spoilable:{},sundowner:{},sweetener:{},trapezium:{},trapezoid:{},umbilical:{},ventricle:{},vestibule:{},zygomatic:{},applesauce:{},autoplasty:{},blackheart:{},breadstuff:{},cheesecake:{},comestible:{},gastronomy:{},hotchpotch:{},interstice:{},jawbreaker:{},kitambilla:{},maraschino:{},metacarpal:{},metatarsal:{},passageway:{},perishable:{},salmagundi:{},shortening:{},articulator:{},excrescence:{},grasshopper:{},griddlecake:{},intercostal:{},longanberry:{},nourishment:{},screwdriver:{},smorgasbord:{},spindlelegs:{},checkerberry:{},perspiration:{},spindleshanks:{},parasympathetic:{},ab:{},ade:{},ale:{},bap:{},bun:{},jak:{},lat:{},lox:{},pes:{},pie:{},poi:{},pud:{},pus:{},tum:{},vas:{},veg:{},anus:{},arak:{},axon:{},baba:{},bile:{},bleb:{},bleu:{},bock:{},bosc:{},choc:{},clit:{},cola:{},coxa:{},crus:{},cuke:{},duff:{},dura:{},edda:{},eggs:{},fist:{},flab:{},flan:{},fugu:{},genu:{},ghee:{},glia:{},grog:{},isaw:{},java:{},kava:{},marc:{},mayo:{},mead:{},miso:{},mons:{},naan:{},nape:{},nipa:{},oleo:{},orzo:{},ouzo:{},ovum:{},pecs:{},pita:{},pone:{},pons:{},porc:{},rete:{},rima:{},rind:{},roux:{},ruga:{},rusk:{},slaw:{},sops:{},suet:{},tofu:{},ugli:{},ulna:{},umbo:{},uvea:{},veal:{},veau:{},vena:{},vino:{},womb:{},ziti:{},zona:{},ackee:{},adobo:{},aioli:{},anjou:{},ankle:{},annon:{},aorta:{},arcus:{},aspic:{},atole:{},axone:{},babka:{},bacon:{},bagel:{},bialy:{},bigos:{},bitok:{},blanc:{},blini:{},bliny:{},boeuf:{},borsh:{},bowel:{},bursa:{},butty:{},cauda:{},cavum:{},cecum:{},celom:{},chips:{},chyle:{},cider:{},congo:{},copra:{},cornu:{},cuppa:{},cutis:{},cyder:{},cytol:{},decaf:{},donut:{},facia:{},femur:{},filum:{},flews:{},fovea:{},fries:{},gigot:{},gland:{},glans:{},gleet:{},glogg:{},glute:{},gonad:{},goody:{},grist:{},grits:{},gruel:{},gyrus:{},hilus:{},hoagy:{},hooch:{},hooks:{},hymen:{},hyson:{},ileum:{},ilium:{},incus:{},inion:{},jello:{},julep:{},kabob:{},kasha:{},kebab:{},knish:{},kumis:{},kvass:{},lansa:{},latke:{},latte:{},lichi:{},limpa:{},lymph:{},macon:{},manus:{},matzo:{},mucus:{},nacho:{},naris:{},nates:{},negus:{},offal:{},ootid:{},pekoe:{},penis:{},penne:{},perry:{},pesto:{},pilaf:{},pinky:{},pizza:{},plica:{},porta:{},pruno:{},psoas:{},pubis:{},quiff:{},raita:{},ramus:{},raphe:{},salmi:{},salsa:{},savoy:{},sebum:{},serum:{},sirup:{},skull:{},sperm:{},steak:{},sudor:{},sushi:{},taffy:{},tamal:{},tater:{},teeth:{},teres:{},tibia:{},titty:{},toddy:{},toffy:{},torso:{},torte:{},tress:{},uvula:{},vagus:{},viand:{},vodka:{},vomer:{},vulva:{},wrist:{},adnexa:{},afters:{},agnail:{},ananas:{},anlage:{},annexa:{},annona:{},antrum:{},armpit:{},arrack:{},axilla:{},baguet:{},beigel:{},biceps:{},bisque:{},blintz:{},bonbon:{},borsch:{},brazil:{},bregma:{},bulgur:{},burger:{},cachou:{},caecum:{},canape:{},canola:{},cardia:{},carina:{},carpus:{},casaba:{},catsup:{},caviar:{},chevre:{},chiasm:{},chilli:{},choana:{},coccyx:{},coelom:{},comedo:{},concha:{},confit:{},congou:{},corium:{},corpse:{},cupper:{},cuspid:{},cutlet:{},damson:{},danish:{},dermis:{},dewlap:{},dolmas:{},eclair:{},eggnog:{},eschar:{},eyelid:{},farina:{},fauces:{},fibula:{},finnan:{},flexor:{},fundus:{},gateau:{},geneva:{},giblet:{},glossa:{},gluten:{},goatee:{},gobbet:{},gonion:{},goober:{},graham:{},grappa:{},groats:{},gulyas:{},haggis:{},hairdo:{},hallah:{},hallux:{},hamate:{},haslet:{},hoagie:{},hominy:{},hommos:{},hootch:{},hotpot:{},huitre:{},hummus:{},inguen:{},intima:{},jambon:{},jugale:{},jumbal:{},karyon:{},kencur:{},kidney:{},kipper:{},kirsch:{},kishke:{},korlan:{},kummel:{},labium:{},lamina:{},lanseh:{},lanugo:{},larynx:{},lekvar:{},limbus:{},lingua:{},lobule:{},lochia:{},locule:{},lunule:{},matzoh:{},meatus:{},meninx:{},milium:{},mohawk:{},mouton:{},mucosa:{},muesli:{},muffin:{},murphy:{},mutton:{},nasion:{},nervus:{},neuron:{},nougat:{},oculus:{},omelet:{},onyxis:{},oocyte:{},oolong:{},operon:{},organs:{},paczki:{},paella:{},palate:{},paries:{},pastis:{},paunch:{},pectus:{},phyllo:{},pilaff:{},pinkie:{},pinole:{},pirogi:{},pleura:{},plexus:{},pollex:{},polony:{},posset:{},potage:{},poteen:{},potion:{},potpie:{},poulet:{},premix:{},pulque:{},purloo:{},quiche:{},rectum:{},rectus:{},repast:{},retina:{},rhaphe:{},ribier:{},rickey:{},rotgut:{},sacrum:{},salami:{},saliva:{},samosa:{},sapota:{},scampi:{},scampo:{},sclera:{},scruff:{},seckel:{},serosa:{},shandy:{},sherry:{},silage:{},skilly:{},smegma:{},soleus:{},sorbet:{},sputum:{},stapes:{},stodge:{},succus:{},sulcus:{},sundae:{},sutura:{},tahini:{},tamale:{},tarsus:{},tendon:{},testis:{},thymus:{},tidbit:{},tiffin:{},tisane:{},titbit:{},toffee:{},tonsil:{},tragus:{},troche:{},tubule:{},tunica:{},unguis:{},ureter:{},uterus:{},vagina:{},veggie:{},venula:{},venule:{},vermis:{},vesica:{},viscus:{},vitals:{},waters:{},whisky:{},wiener:{},yogurt:{},zaatar:{},zonula:{},zonule:{},zygoma:{},zygote:{},absinth:{},akvavit:{},aniseed:{},aquavit:{},arteria:{},ashcake:{},baklava:{},bannock:{},beignet:{},keen:{},rage:{},wish:{},aside:{},chafe:{},gloss:{},tense:{},whole:{},worry:{},effect:{},reject:{},riddle:{},snatch:{},speech:{},closure:{},collect:{},romance:{},flourish:{},classical:{},influence:{},substance:{},reflection:{},inclination:{},recognition:{},dot:{},nod:{},blur:{},itch:{},slur:{},solo:{},wink:{},abuse:{},acute:{},alert:{},angle:{},bluff:{},cheer:{},honor:{},humor:{},lyric:{},snarl:{},tally:{},accent:{},degree:{},detail:{},indent:{},matter:{},patent:{},rubric:{},thrill:{},abandon:{},bluster:{},concern:{},concord:{},formula:{plural:"formulae"},imprint:{},nominal:{},quality:{},reading:{},sputter:{},torture:{},wrinkle:{},contrast:{},estimate:{},harmonic:{},judgment:{},reaction:{},sanction:{},singular:{},straddle:{},construct:{},judgement:{},reflexion:{},rendering:{},universal:{},acceptance:{},discipline:{},irritation:{},regulation:{},relaxation:{},submission:{},application:{},replication:{},construction:{},introduction:{},presentation:{},cant:{},code:{},joke:{},pain:{},stab:{},trot:{},will:{},blame:{},brief:{},dodge:{},fancy:{},glide:{},grasp:{},guess:{},quote:{},scent:{},slant:{},snort:{},swoop:{},theme:{},trial:{},vocal:{},accord:{},affect:{},cancel:{},debate:{},desire:{},heroic:{},murmur:{},phrase:{},resume:{},scream:{},serial:{},tangle:{},closing:{},dissent:{},drawing:{},example:{},exhibit:{},fatigue:{},feeling:{},mention:{},partial:{},posture:{},protest:{},regress:{},telling:{},welcome:{},absolute:{},analysis:{plural:"analyses"},distress:{},pastoral:{},platform:{},temporal:{},agreement:{},attention:{},beginning:{},closeness:{},connexion:{},dimension:{},discourse:{},lightness:{},principle:{},surrender:{},assignment:{},coordinate:{},involution:{},abstraction:{},arrangement:{},conjunction:{},declaration:{},penetration:{},proposition:{},realisation:{},realization:{},condensation:{},consideration:{},no:{},cue:{},fun:{},rub:{},bias:{},gift:{},hoot:{},jazz:{},oral:{},snub:{},text:{},tune:{},urge:{},coast:{},craze:{},daily:{},debut:{},dowse:{},funny:{},logic:{},mercy:{},peace:{},rerun:{},samba:{},slang:{},taboo:{},verse:{},whine:{},words:{},aspect:{},babble:{},canker:{},choice:{},clamor:{},denial:{},device:{},esteem:{},format:{},lament:{},manual:{},menace:{},normal:{},pardon:{},regret:{},skinny:{},sorrow:{},tickle:{},twinge:{},vision:{},warmth:{},caution:{},charter:{},conceit:{},cunning:{},delight:{},dictate:{},discord:{},finance:{},harmony:{},keynote:{},knowing:{},leaning:{},lecture:{},mistake:{},musical:{},offense:{},palaver:{},preempt:{},purpose:{},pyrrhic:{},realism:{},sharing:{},texture:{},worship:{},writing:{},aspirate:{},biweekly:{},blessing:{},citation:{},despatch:{},dullness:{},feminine:{},flatness:{},geminate:{},manifest:{},personal:{},pleasure:{},politics:{},singsong:{},yielding:{},agitation:{},attrition:{},bimonthly:{},broadcast:{},confusion:{},deviation:{},disregard:{},education:{},faintness:{},heaviness:{},imitation:{},indenture:{},interview:{},isolation:{},isometric:{},minuscule:{},portrayal:{},predicate:{},provision:{},screaming:{},signature:{},spiritual:{},throwaway:{},tightness:{},accounting:{},aggression:{},assumption:{},attraction:{},commercial:{},compromise:{},confession:{},confidence:{},conformity:{},conveyance:{},detachment:{},difference:{},discretion:{},imperative:{},mellowness:{},modulation:{},tenderness:{},uneasiness:{},awkwardness:{},discernment:{},elimination:{},endorsement:{},examination:{},fabrication:{},familiarity:{},implication:{},indorsement:{},involvement:{},observation:{},obstruction:{},performance:{},requisition:{},sensitivity:{},testimonial:{},appreciation:{},articulation:{},condemnation:{},confirmation:{},deliberation:{},intervention:{},satisfaction:{},confrontation:{},decomposition:{},determination:{},reinforcement:{},understanding:{},characteristic:{},correspondence:{},sophistication:{},transformation:{},rationalisation:{},rationalization:{},dub:{},fog:{},bold:{},buoy:{},dare:{},daze:{},envy:{},gape:{},okay:{},plus:{},rasp:{},rime:{},role:{},tabu:{},yell:{},above:{},affix:{},agape:{},chord:{},croak:{},doubt:{},email:{},essay:{},folly:{},idiom:{},laugh:{},modal:{},panic:{},posit:{},rhyme:{},rider:{},rumba:{},scare:{},scorn:{},sneer:{},trill:{},truth:{},wince:{},adagio:{},binary:{},daring:{},defeat:{},dismay:{},docket:{},filing:{},flavor:{},giving:{},gospel:{},lesson:{},median:{},neuter:{},notion:{},parody:{},parole:{},plight:{},rebuff:{},rhumba:{},sample:{},shiver:{},solace:{},trance:{},unseen:{},vanity:{},vector:{},amnesty:{},anguish:{},arousal:{},bucolic:{},caption:{},catalog:{},contour:{},descant:{},disdain:{},dispute:{},fantasy:{},flavour:{},glimpse:{},insight:{},languor:{},licence:{},marking:{},overbid:{},prelude:{},probate:{},purport:{},pursuit:{},reality:{},receipt:{},recital:{},riposte:{},splurge:{},sticker:{},summons:{},wrangle:{},approval:{},buoyancy:{},converse:{},coolness:{},covenant:{},crotchet:{},devotion:{},dialogue:{},emphasis:{},esthetic:{},excision:{},fairness:{},fixation:{},forecast:{},hieratic:{},identity:{},illusion:{},integral:{},monotone:{},offering:{},paradigm:{},premiere:{},printing:{},referent:{},rescript:{},research:{},rhetoric:{},schedule:{},skimming:{},sleeping:{},speaking:{},splutter:{},streamer:{},tendency:{},topology:{},vexation:{},wildness:{},adjective:{},aesthetic:{},assurance:{},burlesque:{},catalogue:{},correlate:{},detection:{},discovery:{},dismissal:{},exclusion:{},exclusive:{},expansion:{},impromptu:{},inaugural:{},indicator:{},intensive:{},interdict:{},largeness:{},masculine:{},paragraph:{},partitive:{},pragmatic:{},prevision:{},quarterly:{},quotation:{},readiness:{},rendition:{},reverence:{},roundness:{},safeguard:{},suspicion:{},sweetness:{},thickness:{},trademark:{},antagonism:{},aspiration:{},bitterness:{},coarseness:{},collection:{},conjecture:{},deposition:{},estimation:{},excitement:{},gloominess:{},impossible:{},incitement:{},invocation:{},inwardness:{},literature:{},morphology:{},narrowness:{},nominative:{},observance:{},possessive:{},postmortem:{},preemption:{},preference:{},profession:{},profundity:{},recitation:{},redundancy:{},abnormality:{},acquisition:{},affirmation:{},affirmative:{},alternative:{},bombardment:{},commutation:{},concurrence:{},convergence:{},countenance:{},disposition:{},distinction:{},distraction:{},enlargement:{},expectation:{},fingerprint:{},indentation:{},instruction:{},nationalism:{},possibility:{},presumption:{},publication:{},spectacular:{},speculation:{},substantive:{},superlative:{},unconscious:{},unitisation:{},unitization:{},anticipation:{},apprehension:{},circumstance:{},continuation:{},coordination:{},countercheck:{},distribution:{},hieroglyphic:{},illustration:{},intimidation:{},misdirection:{},overestimate:{},precondition:{},renunciation:{},approximation:{},authorisation:{},authorization:{},certification:{},falsification:{},interrogative:{},nonconformity:{},reduplication:{},sensitiveness:{},sequestration:{},superposition:{},underestimate:{},capitalisation:{},capitalization:{},generalisation:{},generalization:{},perceptiveness:{},recapitulation:{},sensationalism:{},awe:{},bop:{},ego:{},hex:{},jot:{},lit:{},nub:{},vow:{},beta:{},brag:{},clue:{},cull:{},elan:{},epic:{},funk:{},fury:{},gibe:{},hymn:{},jibe:{},leer:{},lust:{},mood:{},oath:{},pang:{},plea:{},quip:{},rant:{},riff:{},visa:{},zeal:{},zest:{},alibi:{},badge:{},basis:{plural:"bases"},bravo:{},carol:{},chant:{},chaos:{},conga:{},delta:{},demur:{},dread:{},fable:{},flair:{},fugue:{},given:{},gloat:{},gloom:{},hunch:{},infix:{},irony:{},largo:{},least:{},libel:{},magic:{},moral:{},polka:{},reply:{},sally:{},spiel:{},spook:{},stymy:{},tango:{},usage:{},velar:{},vigil:{},whoop:{},affair:{},airing:{},ardour:{},ballot:{},bathos:{},beauty:{},bellow:{},bowing:{},curtsy:{},deceit:{},dental:{},dialog:{},gambit:{},gibber:{},grudge:{},halloo:{},insult:{},intent:{},italic:{},kowtow:{},labial:{},latest:{},manner:{},mumble:{},naming:{},outcry:{},pathos:{},piffle:{},plural:{},policy:{},praise:{},raving:{},rehash:{},revise:{},scalar:{},scroll:{},seeing:{},shriek:{},sonnet:{},stymie:{},tattle:{},theory:{},tingle:{},tumult:{},upbeat:{},urging:{},wangle:{},weekly:{},wheeze:{},yearly:{},acclaim:{},acidity:{},airmail:{},analogy:{},apology:{},barrage:{},barrier:{},bidding:{},bonding:{},buildup:{},cadence:{},cartoon:{},censure:{},clutter:{},concert:{},cruelty:{},despair:{},disgust:{},dodging:{},earmark:{},embargo:{},enquiry:{},erasure:{},eristic:{},fluency:{},gradual:{},gravity:{},initial:{},inquiry:{},lingual:{},loyalty:{},mastery:{},mimesis:{},monthly:{},numeral:{},omnibus:{},outlook:{},palatal:{},placard:{},polemic:{},posting:{},presage:{},preview:{},quibble:{},refrain:{},reissue:{},reorder:{},reprint:{},rewrite:{},roundup:{},singing:{},slander:{},sorting:{},tasting:{},tribute:{},turmoil:{},whisper:{},ablative:{},acridity:{},allegory:{},alveolar:{},ambition:{},ascender:{},audition:{},binomial:{},brandish:{},brooding:{},bundling:{},calculus:{},circular:{},clipping:{},coldness:{},courtesy:{},critique:{},daydream:{},defiance:{},delusion:{},demurrer:{},disfavor:{},disquiet:{},dynamism:{},easiness:{},equation:{},fondness:{},grasping:{},grouping:{},guidance:{},guttural:{},hornpipe:{},hysteria:{},idealism:{},intimacy:{},mistrust:{},monition:{},negation:{},nickname:{},nihilism:{},notation:{},ordinate:{},outburst:{},particle:{},passport:{},pedagogy:{},petition:{},phantasy:{},planning:{},playbook:{},proposal:{},revision:{},rhapsody:{},ridicule:{},sampling:{},serenade:{},slowness:{},sourness:{},subtitle:{},suspense:{},sympathy:{},tartness:{},teaching:{},theology:{},travesty:{},universe:{},acuteness:{},addiction:{},adoration:{},attending:{},autograph:{},constancy:{},crispness:{},cuneiform:{},deception:{},defensive:{},denseness:{},dialectic:{},dictation:{},digestion:{},diplomacy:{},disfavour:{},editorial:{},emulation:{},enactment:{},evocation:{},fecundity:{},footprint:{},formalism:{},formative:{},gradation:{},grievance:{},grumbling:{},guideline:{},immediacy:{},insurance:{},intention:{},intercept:{},invariant:{},itinerary:{},lassitude:{},majuscule:{},misgiving:{},monologue:{},morbidity:{},murmuring:{},narration:{},nutrition:{},ordinance:{},oversight:{},pictorial:{},pizzicato:{},prejudice:{},quadratic:{},quickness:{},quickstep:{},reckoning:{},reflexive:{},rejoicing:{},repulsion:{},retention:{},retrieval:{},revealing:{},saltiness:{},schooling:{},sentience:{},sulkiness:{},synthesis:{},testament:{},testimony:{},underline:{},undertone:{},accidental:{},accusative:{},adaptation:{},admiration:{},affixation:{},allurement:{},anatomical:{},antiphonal:{},asceticism:{},belittling:{},brightness:{},brilliance:{},chronology:{},classified:{},cleverness:{},clumsiness:{},cognizance:{},compliment:{},concession:{},conscience:{},conspiracy:{},contention:{},continuity:{},decoration:{},determiner:{},deterrence:{},digression:{},diminution:{},discontent:{},dissection:{},dissonance:{},divination:{},empiricism:{},enthusiasm:{},enticement:{},equivalent:{},execration:{},fortissimo:{},grogginess:{},hesitation:{},humbleness:{},hypostasis:{},hypothesis:{plural:"hypotheses"},impatience:{},infliction:{},insistence:{},instalment:{},intermezzo:{},jocularity:{},loneliness:{},neutrality:{},nomination:{},oppression:{},perfection:{},pestilence:{},philosophy:{},precaution:{},pretension:{},propensity:{},refutation:{},reputation:{},revelation:{},rumination:{},salutation:{},semiweekly:{},stigmatism:{},theatrical:{},triviality:{},underscore:{},unfairness:{},vernacular:{},vocabulary:{},whispering:{},acceptation:{},advancement:{},aggravation:{},appellative:{},benevolence:{},calculation:{},comparative:{},concordance:{},conjunctive:{},conjuration:{},correlation:{},correlative:{},countersign:{},denigration:{},designation:{},discourtesy:{},documentary:{},electricity:{},enchantment:{},engrossment:{},exclamation:{},explanation:{},exploration:{},foolishness:{},frustration:{},imperialism:{},infatuation:{},inscription:{},jactitation:{},obfuscation:{},outwardness:{},peculiarity:{},playfulness:{},presentment:{},propagation:{},provocation:{},rationalism:{},regionalism:{},repudiation:{},resignation:{},rotogravure:{},semimonthly:{},sensibility:{},seriousness:{},stipulation:{},strangeness:{},subcontract:{},supposition:{},syncopation:{},titillation:{},tranquility:{},unorthodoxy:{},unsoundness:{},valedictory:{},breakthrough:{},choreography:{},conciliation:{},constitution:{},consultation:{},counterpoint:{},covetousness:{},depreciation:{},faultfinding:{},heedlessness:{},helplessness:{},idealisation:{},idealization:{},impertinence:{},intoxication:{},irritability:{},mercifulness:{},notification:{},pacification:{},processional:{},promulgation:{},proportional:{},recollection:{},retroflexion:{},retroversion:{},significance:{},solicitation:{},spiritualism:{},stupefaction:{},supplication:{},transference:{},acculturation:{},attentiveness:{},communication:{},comprehensive:{},condescension:{},contradiction:{},demonstrative:{},determinative:{},documentation:{},hallucination:{},impersonation:{},individualism:{},interpolation:{},orchestration:{},preoccupation:{},prevarication:{},qualification:{},retentiveness:{},retroflection:{},structuralism:{},symbolisation:{},symbolization:{},versification:{},aggressiveness:{},categorisation:{},demoralisation:{},demoralization:{},farsightedness:{},predisposition:{},recommendation:{},reconstruction:{},sesquipedalian:{},simplification:{},traditionalism:{},conventionality:{},crystallization:{},personification:{},prognostication:{},characterization:{},predetermination:{},pi:{},xi:{},boo:{},bye:{},dit:{},fib:{},ire:{},ken:{},nay:{},pic:{},psi:{},pun:{},wai:{},woe:{},yea:{},blip:{},blog:{},deed:{},demo:{},epos:{},gist:{},grin:{},heed:{},idyl:{},iota:{},jive:{},moan:{},muse:{},norm:{},noun:{},nous:{},odor:{},pean:{},ploy:{},pomp:{},quiz:{},sass:{},sext:{},spam:{},sulk:{},surd:{},tale:{},trig:{},vlog:{},whim:{},yack:{},yoga:{},agony:{},alias:{},aroma:{},axiom:{},bebop:{},blues:{},bonus:{},canto:{},codex:{},creed:{},ditto:{},dogma:{},drawl:{},edict:{},ethic:{},facet:{},fever:{},frown:{},gamma:{},gamut:{},grief:{},groan:{},guilt:{},intro:{},kotow:{},macro:{},odour:{},omega:{},paean:{},pavan:{},peeve:{},prate:{},primo:{},prose:{},psalm:{},qualm:{},retro:{},rumor:{},savvy:{},scowl:{},shrug:{},skill:{},smirk:{},danger:{},push:{},refusal:{},tooling:{},trelvox:{}},verbs:{import:{},call:{},test:{},contain:{},extend:{},use:{},depend:{prep:"on"},rely:{prep:"on"},inherit:{prep:"from"},belong:{prep:"to",predicate:"mgx:partOf"},point:{prep:"to"},implement:{},override:{},export:{},define:{},declare:{},reference:{},invoke:{},wrap:{},mock:{},cover:{},document:{},describe:{},modify:{},touch:{},fix:{},break:{},introduce:{},deprecate:{},replace:{},own:{},maintain:{},review:{},merge:{},revert:{},deploy:{},run:{},execute:{},load:{},parse:{},emit:{},validate:{},log:{},throw:{},catch:{},create:{},delete:{},update:{},expose:{},consume:{},produce:{},generate:{},configure:{},install:{},publish:{},release:{},ship:{},watch:{},trigger:{},build:{},write:{},read:{},have:{},like:{},want:{},need:{},believe:{},trust:{},love:{},hate:{},fear:{},hope:{},teach:{},learn:{},drive:{},cook:{},sing:{},visit:{},care:{},grow:{},marry:{},wear:{},eat:{},sleep:{},walk:{},buy:{},sell:{},give:{},take:{},meet:{},ride:{},speak:{},duck:{}},adjectives:{legacy:{type:"subclass"},mock:{type:"subclass"},senior:{type:"subclass"},internal:{type:"subclass"},external:{type:"subclass"},public:{type:"subclass"},private:{type:"subclass"},abstract:{type:"subclass"},static:{type:"subclass"},async:{type:"subclass"},experimental:{type:"subclass"},stable:{type:"subclass"},core:{type:"subclass"},shared:{type:"subclass"},global:{type:"subclass"},local:{type:"subclass"},generated:{type:"subclass"},standalone:{type:"subclass"},primary:{type:"subclass"},secondary:{type:"subclass"},deprecated:{type:"data"},fast:{type:"data"},slow:{type:"data"},large:{type:"data"},small:{type:"data"},flaky:{type:"data"},tested:{type:"data"},documented:{type:"data"},buggy:{type:"data"},broken:{type:"data"},green:{type:"data"},deterministic:{type:"data"},pure:{type:"data"},empty:{type:"data"},stale:{type:"data"},male:{type:"data"},female:{type:"data"},young:{type:"data"},old:{type:"data"},hot:{type:"data"},cold:{type:"data"},sweet:{type:"data"},salty:{type:"data"},sharp:{type:"data"},round:{type:"data"},tall:{type:"data"},short:{type:"data"},happy:{type:"data"},sad:{type:"data"},angry:{type:"data"},afraid:{type:"data"},strong:{type:"data"},weak:{type:"data"},rich:{type:"data"},poor:{type:"data"},hard:{type:"data"},soft:{type:"data"},wild:{type:"data"},gentle:{type:"data"},colorful:{type:"data"},legitimate:{type:"data"},ranked:{type:"data"},related:{type:"data"},sacred:{type:"data"},unaffected:{type:"data"}},properNames:["tmct","Node","npm","JavaScript","TypeScript","Python","Java","Git","GitHub","GitLab","ESLint","Linux","macOS","Windows","Polycode","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]}});var $v={};Nt($v,{CODE_REF_SHAPE:()=>nl,DETERMINERS:()=>dp,OF_CLASSIFIER_HEADS:()=>pp,OF_PARTITIVE_HEADS:()=>mp,QUANTIFIERS:()=>fp,classify:()=>hp,loadLexicon:()=>wn,lookupAdjective:()=>Ki,lookupNoun:()=>Cn,lookupProperName:()=>zr,lookupVerb:()=>qi,numberOf:()=>Hi,predicateOf:()=>tl,readsAsIndividualName:()=>sl,thirdPerson:()=>bv,withProperNames:()=>yv});function Hi(e){let t=String(e??"").trim().toLowerCase();return/^\d+$/.test(t)?Number(t):sN[t]??null}function bv(e){let t=String(e);return t==="have"?"has":/[^aeiou]y$/.test(t)?`${t.slice(0,-1)}ies`:/(s|x|z|ch|sh)$/.test(t)?`${t}es`:`${t}s`}function tl(e,t=gv){if(e.predicate)return e.predicate;let n=e.prep?e.prep[0].toUpperCase()+e.prep.slice(1):"";return`${t}${bv(e.lemma)}${n}`}function wv(e){let t=String(e),n=[t];return t.length>4&&/[a-z]ies$/.test(t)&&n.push(`${t.slice(0,-3)}y`),/(ses|xes|zes|ches|shes)$/.test(t)&&n.push(t.slice(0,-2)),/[a-z]s$/.test(t)&&!/ss$/.test(t)&&n.push(t.slice(0,-1)),t==="has"&&n.push("have"),n}function hv(e,t={}){for(let[n,s]of Object.entries(t.nouns||{})){let o={lemma:n,...s||{}};if(o.property&&!oN.has(o.property))throw new Error(`lexicon noun "${n}": property must be "data" or "object", got ${JSON.stringify(o.property)}`);e.nouns.set(n,o),o.plural&&e.nounPlurals.set(o.plural,n)}for(let[n,s]of Object.entries(t.verbs||{}))e.verbs.set(n,{lemma:n,...s||{}});for(let[n,s]of Object.entries(t.adjectives||{})){let o={lemma:n,...s||{}};if(!rN.has(o.type))throw new Error(`lexicon adjective "${n}": type must be "subclass" or "data", got ${JSON.stringify(o.type)}`);e.adjectives.set(n,o)}for(let n of t.properNames||[])e.properNames.set(String(n).toLowerCase(),String(n))}function wn(e,t=gv){if(!e&&up.has(t))return up.get(t);let n=mv,s={nouns:new Map,nounPlurals:new Map,verbs:new Map,adjectives:new Map,properNames:new Map,ns:t};return hv(s,n),e?(hv(s,e),s):(up.set(t,s),s)}function yv(e,t){let n=new Map(e.properNames);for(let s of t)n.set(String(s).toLowerCase(),String(s));return{...e,properNames:n}}function Cn(e,t,n={}){return iN(e,t,n)[0]??null}function iN(e,t,n={}){let s=String(t??"").toLowerCase(),o=e.nouns.get(s),r=e.nounPlurals.get(s),i=[],a=new Set,c=l=>{l&&!a.has(l.lemma)&&(a.add(l.lemma),i.push(l))};if(r){let l=e.nouns.get(r)??null;return n.singularOnly&&o?(c(o),c(l)):(c(l),c(o)),i}for(let l of wv(s))c(e.nouns.get(l));return i}function qi(e,t){return aN(e,t)[0]??null}function aN(e,t){let n=String(t??"").toLowerCase(),s=[],o=new Set;for(let r of wv(n)){let i=e.verbs.get(r);i&&!o.has(i.lemma)&&(o.add(i.lemma),s.push(i))}return s}function Ki(e,t){return e.adjectives.get(String(t??"").toLowerCase())??null}function zr(e,t){return e.properNames.get(String(t??"").toLowerCase())??null}function sl(e,t){let n=String(e??"");if(!n)return!1;if(zr(t,n)||nl.test(n)||/^[a-z][\w]*(?:-[\w]+)+$/i.test(n)||/^[A-Z]/.test(n))return!0;let s=Cn(t,n);return s?s.lemma.toLowerCase()!==n.toLowerCase():!0}function hp(e,t=wn()){let n=String(e??"").trim();if(!n)return null;let s=n.toLowerCase();if(dp[s])return{pos:"determiner",type:dp[s]};if(fp[s])return{pos:"quantifier",type:fp[s]};let o=Hi(s);if(o!=null)return{pos:"number",type:"cardinal",value:o};let r=zr(t,n);if(r)return{pos:"properName",type:"individual",canonical:r};let i=Cn(t,s);if(i)return i.property?{pos:"noun",type:`${i.property}-property`,lemma:i.lemma,property:i.property}:{pos:"noun",type:"class",lemma:i.lemma};let a=qi(t,s);if(a)return{pos:"verb",type:"objectProperty",lemma:a.lemma,predicate:tl(a,t.ns),...a.prep?{prep:a.prep}:{}};let c=Ki(t,s);return c?{pos:"adjective",type:c.type,lemma:c.lemma}:null}var gv,dp,fp,pp,mp,sN,oN,rN,up,nl,cs=M(()=>{pv();gv="tmct:",dp=Object.freeze({every:"universal",a:"indefinite",an:"indefinite",the:"definite",no:"negative"}),fp=Object.freeze({"at least":"owl:minCardinality","at most":"owl:maxCardinality",exactly:"owl:cardinality"}),pp=Object.freeze(new Set(["type","kind","sort","form","class","variety","species","breed","genus"])),mp=Object.freeze(new Set(["body","mass","group","collection","set","series","number","amount","piece","part","lot","pair","bunch","pile"])),sN=Object.freeze({one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10});oN=new Set(["data","object"]),rN=new Set(["subclass","data"]);up=new Map;nl=/[./\\#:@]/});var bV,wV,yV,cN,$V,vV,xV,vv=M(()=>{Jn();De();bV=Object.freeze({class:"Class",module:"Module",function:"Function",method:"Method",attribute:"Attribute",variable:"GlobalVariable",constant:"GlobalVariable",commit:"Commit"}),wV=Object.freeze({Class:["class","classes"],Module:["module","modules"],Function:["function","functions"],Method:["method","methods"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"]}),yV=Object.freeze({Class:[e=>`which classes inherit from ${e}`,e=>`what does ${e} contain`,e=>`where is ${e} defined`],Module:[e=>`what does ${e} import`,e=>`which modules import ${e}`,e=>`where is ${e} defined`],Function:[e=>`what calls ${e}`,e=>`what does ${e} call`,e=>`where is ${e} defined`],Method:[e=>`which class contains ${e}`,e=>`what calls ${e}`,e=>`where is ${e} defined`],Attribute:[e=>`which class contains ${e}`,e=>`where is ${e} defined`],GlobalVariable:[e=>`where is ${e} defined`,e=>`where is ${e} mentioned`],Commit:[e=>`what did commit ${e} touch`,e=>`when did ${e} change`]}),cN=Object.freeze({import:"imports",imports:"imports",importing:"imports",imported:"imports",call:"calls",calls:"calls",calling:"calls",called:"calls",invoke:"calls",invokes:"calls",invoking:"calls",contain:"contains",contains:"contains",containing:"contains",containment:"contains",member:"contains",members:"contains",inherit:"inherits",inherits:"inherits",inheriting:"inherits",inheritance:"inherits",extend:"inherits",extends:"inherits",extending:"inherits",subclass:"inherits",subclasses:"inherits",subclassing:"inherits",test:"tests",tests:"tests",testing:"tests",tested:"tests",coverage:"tests",define:"defines",defines:"defines",defining:"defines",defined:"defines",definition:"defines",definitions:"defines",declaration:"defines",touch:"touches",touches:"touches",touching:"touches",touched:"touches",cochange:"cochange","co-change":"cochange","change-coupling":"cochange",coupled:"cochange",export:"reexports",exports:"reexports",exporting:"reexports",exported:"reexports",reexport:"reexports",reexports:"reexports",reexporting:"reexports","re-export":"reexports","re-exports":"reexports","re-exporting":"reexports",serve:"serves",serves:"serves",serving:"serves",served:"serves",denote:"denotes",denotes:"denotes",denoting:"denotes",denoted:"denotes"}),$V=Object.freeze({imports:["imports"],calls:["calls","callsSymbol"],contains:["contains"],inherits:["inherits"],tests:["tests"],defines:["defines"],touches:["touches","touchesSymbol"],cochange:["cochange"],reexports:["reexports"],serves:["serves"],denotes:["denotes"]}),vV=Object.freeze({imports:{verb:"imports",edgeNoun:"import"},calls:{verb:"calls",edgeNoun:"call"},contains:{verb:"contains",edgeNoun:"containment"},inherits:{verb:"inherits from",edgeNoun:"inheritance"},tests:{verb:"tests",edgeNoun:"test"},defines:{verb:"defines",edgeNoun:"definition"},touches:{verb:"touches",edgeNoun:"touch"},cochange:{verb:"changes together with",edgeNoun:"change-coupling"},reexports:{verb:"re-exports",edgeNoun:"re-export"},serves:{verb:"serves",edgeNoun:"service"},denotes:{verb:"denotes",edgeNoun:"denotation"}}),xV=Object.freeze({imports:[{side:"obj",make:e=>`which modules import ${e}`},{side:"subj",make:e=>`what does ${e} import`}],calls:[{side:"obj",make:e=>`what calls ${e}`},{side:"subj",make:e=>`what does ${e} call`}],contains:[{side:"subj",make:e=>`what does ${e} contain`},{side:"obj",make:e=>`which class contains ${e}`}],inherits:[{side:"obj",make:e=>`which classes inherit from ${e}`},{side:"subj",make:e=>`where is ${e} defined`}],tests:[{side:"obj",make:e=>`what tests ${e}`},{side:"obj",make:e=>`where is ${e} defined`}],defines:[{side:"obj",make:e=>`where is ${e} defined`},{side:"subj",make:e=>`what does ${e} contain`}],touches:[{side:"obj",make:e=>`when did ${e} change`},{side:"subj",make:e=>`what did commit ${e} touch`}],cochange:[{side:"obj",make:e=>`where is ${e} defined`},{side:"subj",make:e=>`which modules import ${e}`}],reexports:[{side:"subj",make:e=>`what does ${e} export`},{side:"obj",make:e=>`where is ${e} defined`}],serves:[{side:"subj",make:e=>`what does ${e} serve`},{side:"obj",make:e=>`what serves ${e}`}],denotes:[{side:"subj",make:e=>`what does ${e} denote`},{side:"obj",make:e=>`what denotes ${e}`}]})});function Yi(e){if(!e||typeof e!="object")return!1;for(let t of["term","title","text","summary","url"])if(typeof e[t]!="string"||!e[t])return!1;if(!Number.isInteger(e.revid)||e.revid<=0)return!1;for(let t of["isa","source","licence"])if(e[t]!==void 0&&(typeof e[t]!="string"||!e[t]))return!1;return!0}function rl(e,t){let n=String(e??"").split(/(?<=[.!?])\s+/),s="";for(let o of n){let r=s?`${s} ${o}`:o;if(r.length>t)break;s=r}return s||String(e??"").slice(0,t)}function uN(e){let t=e,n;do n=t,t=t.replace(/\s*\([^()]*\)/g,"");while(t!==n);return t}function Ev(e,t){let n=Cn(t,e);return n?q(n.lemma):e}function Sv(e,t){let n=uN(String(e??"")).match(lN);if(!n)return null;let s=!n[1],o=[];for(let u of n[2].trim().split(/\s+/))if(dN.has(u)||(o.push(u),o.length>=6))break;let r=o;for(let u=r.indexOf("of");u>0;u=r.indexOf("of")){let d=r[u-1]?.split("-").pop(),p=d&&Ev(d,t);if(p&&(pN.has(p)||mN.has(p))){r=r.slice(u+1);continue}r=r.slice(0,u);break}for(;r.length&&fN.has(r[0]);)r=r.slice(1);if(!r.length)return null;let i=r[r.length-1].split("-").pop();if(!i)return null;let a=Ev(i,t);if(xv.has(i)||xv.has(a))return null;let c=Cn(t,i);if(!c)return null;let l=q(c.lemma);return s&&(!/s$/.test(i)||q(i)===l)?null:l}var ol,lN,dN,xv,fN,pN,mN,Ur=M(()=>{it();cs();vv();ol=400;lN=/^[A-Z][^.!?]*? (?:is|are) (?:(a|an|the) )?([a-z][a-z -]{1,60})/;dN=new Set(["that","which","where","who","whose","whom","when","used","found","made","with","in","on","for","from","by","to","and","or"]),xv=new Set(["type","kind","sort","form","class","variety","group","part","piece","member","way","term","name","word","thing","example","family","genus","species","unit","series","set","list","number","amount","body","mass"]),fN=new Set(["a","an","the"]),pN=new Set(["type","kind","sort","form","class","variety","species","breed","genus","group","part","parts","piece","bunch","bit","name","set","way","unit","family","ability","color","series","mammal","practice","list","amount","mass","reworking","blockage","goddess","aura","development","consisting","announcement","messengers","subset","carrying","photograph","adding","use","science","songbird","symptom","accumulation","number","suborder","falling","management","evaluation","superorder","activity","interlacing","introduction"]),mN=new Set(["either","one","each","both","any"])});var il,al=M(()=>{il=()=>{throw new Error("gunzipSync unavailable in a browser bundle")}});var hN,LV,jv=M(()=>{Bo();al();ao();Je();Ur();hN={},LV=ne(ye(qt(hN.url)),"..","..","..")});function bN(e){if(!e||typeof e!="object")return!1;for(let t of["subject","predicate","object","provenance"])if(typeof e[t]!="string"||!e[t])return!1;return gN.includes(e.predicate)}function kv(e){return Yi(e)?e.facts===void 0?!0:Array.isArray(e.facts)&&e.facts.length>0&&e.facts.every(bN):!1}function Xi(e,t){return`research:${e}:${q(t)}`}function cl(e){if(!e||typeof e.name!="string"||!e.name||typeof e.create!="function")throw new Error("registerResearchSource: expected { name, create(options) }");wN.set(e.name,{name:e.name,create:e.create})}var gN,wN,DV,zV,Br=M(()=>{it();Ur();gN=Object.freeze(["rdf:type","rdfs:subClassOf","mgx:partOf","mgx:hasA","mgx:usedFor","mgx:capableOf","mgx:atLocation","mgx:causes","mgx:madeOf","mgx:createdBy","mgx:locatedNear","mgx:hasProperty"]);wN=new Map;DV=Object.freeze(["wikipedia","wikidata","simple-wikipedia","wiktionary","dbpedia"]),zV=Object.freeze({wikipedia:"simple-wikipedia",wikidata:"wikidata","simple-wikipedia":"simple-wikipedia",wiktionary:"wiktionary",dbpedia:"dbpedia-lookup"})});function Ji({fetchImpl:e,timeoutMs:t=4e3,minIntervalMs:n=2e3,retryAfterFloorMs:s=5e3,userAgent:o,waitForSlot:r=!1,validators:i=null}={}){let a=e??((...v)=>globalThis.fetch(...v)),c=new Map,l=0,u=0,d=!1,p=()=>{if(!o)return null;let v={"Api-User-Agent":o};return typeof document>"u"&&(v["User-Agent"]=o),v};function f(v){let S=Number(v)*1e3;u=Date.now()+Math.max(S||0,s)}function m(v){let S=i?.get(v);if(!S)return null;let C={};return S.etag&&(C["If-None-Match"]=S.etag),S.lastModified&&(C["If-Modified-Since"]=S.lastModified),Object.keys(C).length?C:null}function h(v,S){if(!i)return;let C=S.headers?.get?.("etag")??"",x=S.headers?.get?.("last-modified")??"";if(!C&&!x)return;let R=i.get(v)??{};i.set(v,{etag:C||R.etag||"",lastModified:x||R.lastModified||""})}async function g(v,{asJson:S}){let C=typeof AbortController=="function"?new AbortController:null,x=C?setTimeout(()=>C.abort(),t):null;try{let R={};C&&(R.signal=C.signal);let w={...p()??{},...m(v)??{}};Object.keys(w).length&&(R.headers=w);let T=await a(v,R);if(T.status===429)return f(T.headers?.get?.("retry-after")),null;if(T.status===304)return i?{notModified:!0}:null;if(!T.ok)return null;if(h(v,T),S){let I=await T.json();return I?.error?.code==="maxlag"?(f(T.headers?.get?.("retry-after")),null):I}return await T.text()}catch{return null}finally{x!==null&&clearTimeout(x)}}async function b(v){return g(v,{asJson:!0})}async function y(v){return g(v,{asJson:!1})}let $=()=>Math.max(u,l+n);async function E(){for(;;){let v=Date.now();if(!d&&v>=$())return l=v,d=!0,!0;if(!r)return!1;await new Promise(S=>setTimeout(S,Math.max($()-v,25)))}}async function _(v,S,{remember:C=!0}={}){if(c.has(v))return c.get(v);if(!await E())return null;let x=null;try{x=await S()}catch{x=null}finally{d=!1}return C&&c.set(v,x),x}return{fetchJson:b,fetchText:y,cachedFetch:_}}var Qi=M(()=>{});function EN({fetchImpl:e,origin:t=yN,timeoutMs:n=4e3,minIntervalMs:s=2e3,lexicon:o=null,userAgent:r=xN,waitForSlot:i=!1,sourceName:a=vN}={}){let c=Ji({fetchImpl:e,timeoutMs:n,minIntervalMs:s,userAgent:r,waitForSlot:i});function l(p,f){let m=Array.isArray(f?.[1])?f[1]:[];for(let h of m){let g=q(h);if(g===p||g.startsWith(p))return String(h)}return null}async function u(p,f){let m=await c.fetchJson(`${t}/api/rest_v1/page/summary/${encodeURIComponent(f.replace(/ /g,"_"))}`);if(!m)return null;let h=String(m.extract??""),g=Number(m.revision),b={term:p,title:String(m.title??f),text:h,summary:rl(h,ol),url:String(m.content_urls?.desktop?.page??`${t}/wiki/${encodeURIComponent(f.replace(/ /g,"_"))}`),revid:g},y=o;if(!y)try{y=wn()}catch{y=null}let $=y?Sv(h,y):null;return $&&(b.isa=$),Yi(b)?b:null}async function d(p){let f=await c.fetchJson(`${t}/w/api.php?action=opensearch&format=json&origin=*&maxlag=${5}&search=${encodeURIComponent(p)}&limit=3`),m=f?l(p,f):null;return m?u(p,m):null}return{name:a,origin:t,provenanceTag(p){return Xi(a,p)},async lookup(p){let f=String(p??"");return f?c.cachedFetch(f,()=>d(f)):null},async pageByTitle(p){let f=String(p??"").trim();return f?c.cachedFetch(`title\0${q(f)}`,()=>u(q(f),f)):null},async linkedTitles(p,{limit:f=25}={}){let m=String(p??"").trim();if(!m)return null;let h=await c.cachedFetch(`links\0${q(m)}`,async()=>{let b=(await c.fetchJson(`${t}/w/api.php?action=parse&format=json&formatversion=2&origin=*&maxlag=${5}&prop=links&redirects=1&page=${encodeURIComponent(m)}&section=0`))?.parse?.links;if(!Array.isArray(b))return null;let y=new Set,$=[];for(let E of b){if(!E||E.ns!==0||E.exists===!1)continue;let _=String(E.title??E["*"]??"").trim(),v=q(_);!_||!v||y.has(v)||(y.add(v),$.push(_))}return $});return Array.isArray(h)?h.slice(0,Math.max(0,f)):null}}}function SN(e={}){return EN({origin:$N,sourceName:_v,waitForSlot:!0,...e})}var yN,$N,vN,_v,xN,Tv=M(()=>{it();cs();Ur();Br();Qi();yN="https://en.wikipedia.org",$N="https://simple.wikipedia.org",vN="wikipedia-live",_v="simple-wikipedia",xN="the-mechanical-code-talker (+https://tmct.polycode.co.uk/)";cl({name:_v,create:SN})});function ON(e,t){let n=Array.isArray(t?.search)?t.search:[],s=null;for(let o of n){let r=String(o?.id??"");if(!Cv.test(r))continue;let i=q(o?.label??"");if(i===e)return r;s===null&&i.startsWith(e)&&(s=r)}return s}function NN(e){let t=[];for(let[n,s]of Object.entries(TN)){let o=e?.claims?.[n];if(!Array.isArray(o))continue;let r=0;for(let i of o){if(t.length>=IN)return t;if(r>=CN)break;let a=i?.mainsnak;if(a?.snaktype!=="value")continue;let c=String(a?.datavalue?.value?.id??"");Cv.test(c)&&(t.push({property:n,predicate:s,id:c}),r+=1)}}return t}function LN(e,t,n){for(let s of AN)for(let o of e){if(o.property!==s)continue;let r=t.get(o.id);if(r&&r!==n)return r}return null}function PN({fetchImpl:e,origin:t=jN,timeoutMs:n=4e3,minIntervalMs:s=2e3,userAgent:o=_N,waitForSlot:r=!1,sourceName:i=Av}={}){let a=Ji({fetchImpl:e,timeoutMs:n,minIntervalMs:s,userAgent:o,waitForSlot:r}),c=d=>`${t}/w/api.php?${new URLSearchParams({format:"json",origin:"*",maxlag:String(5),...d})}`;async function l(d){let p=new Map;if(!d.length)return p;let f=await a.fetchJson(c({action:"wbgetentities",languages:"en",props:"labels",ids:d.join("|")}));for(let[m,h]of Object.entries(f?.entities??{})){let g=q(h?.labels?.en?.value??"");g&&p.set(m,g)}return p}async function u(d){let p=await a.fetchJson(c({action:"wbsearchentities",language:"en",uselang:"en",type:"item",limit:"5",search:d})),f=p?ON(d,p):null;if(!f)return null;let h=(await a.fetchJson(c({action:"wbgetentities",languages:"en",props:"labels|descriptions|claims|info",ids:f})))?.entities?.[f];if(!h)return null;let g=NN(h),b=await l(g.map(C=>C.id)),y=Xi(i,d),$=[],E=new Set;for(let C of g){let x=b.get(C.id);!x||x===d||E.has(`${C.predicate}\0${x}`)||(E.add(`${C.predicate}\0${x}`),$.push({subject:d,predicate:C.predicate,object:x,provenance:y}))}let _=String(h.descriptions?.en?.value??""),v={term:d,title:String(h.labels?.en?.value??""),text:_,summary:rl(_,ol),url:`${t}/wiki/${f}`,revid:Number(h.lastrevid),source:kN,licence:RN},S=LN(g,b,d);return S&&(v.isa=S),$.length&&(v.facts=$),kv(v)?v:null}return{name:i,origin:t,provenanceTag(d){return Xi(i,d)},async lookup(d){let p=q(d??"");return p?a.cachedFetch(p,()=>u(p)):null}}}function MN(e={}){return PN({waitForSlot:!0,...e})}var jN,Av,kN,RN,_N,TN,AN,CN,IN,Cv,Iv=M(()=>{it();Ur();Br();Qi();jN="https://www.wikidata.org",Av="wikidata",kN="Wikidata",RN="CC0 1.0",_N="the-mechanical-code-talker (+https://tmct.polycode.co.uk/)",TN=Object.freeze({P31:"rdf:type",P279:"rdfs:subClassOf",P361:"mgx:partOf",P527:"mgx:hasA",P186:"mgx:madeOf",P366:"mgx:usedFor",P276:"mgx:atLocation",P1542:"mgx:causes",P170:"mgx:createdBy",P2670:"mgx:hasA"}),AN=["P279","P31"],CN=3,IN=12,Cv=/^Q[1-9][0-9]*$/;cl({name:Av,create:MN})});var FN,DN,iH,gp=M(()=>{it();cs();hr();Br();FN=Object.freeze({fanoutLimit:5,maxDepth:1,maxTopics:12,minIntervalMs:2e3,source:"wikipedia"}),DN=["this","is","about","the"],iH=DN.length});var Ov=M(()=>{Lt();Je()});var bp,dl,Zi=M(()=>{bp=new Set(["person","place","object","event","time","quantity","organization","group","animal","plant","furniture","vehicle","insect","emotion","metal","liquid","weather","planet","jewelry","cutlery","government","material","artifact","location","structure","food","drink","clothing","body","language","mind","family","meal","season","number","entity","abstraction","physical_entity","attribute","state","act","communication","cognition","measure","unit"]),dl=new Set([...bp,"property","concept","idea","content"])});var Nv=M(()=>{it();sp();Zi();fi();Mn()});var Lv=M(()=>{it()});var fl=M(()=>{Sn();fr()});var Pv=M(()=>{it()});var zN,Mv,Fv,Dv,NH,zv=M(()=>{Pv();Qi();zN=250,Mv=Object.freeze([{id:"wikimedia-featured",name:"Wikimedia featured feed",kind:"contemporary",format:"wikimedia-feed",url:"https://api.wikimedia.org/feed/v1/wikipedia/en/featured",homepage:"https://www.wikipedia.org/",licence:"CC BY-SA 4.0",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!0},{id:"hacker-news",name:"Hacker News",kind:"contemporary",format:"hn",url:"https://hacker-news.firebaseio.com/v0",homepage:"https://news.ycombinator.com/",licence:"user-submitted, discussion linked",browserVerified:"2026-08-08",minIntervalMs:zN,enabledByDefault:!0},{id:"usgs-quakes",name:"USGS earthquakes",kind:"contemporary",format:"usgs",url:"https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson",homepage:"https://earthquake.usgs.gov/",licence:"US public domain",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!0},{id:"nyt-world",name:"NYT World News",kind:"contemporary",format:"rss",url:"https://rss.nytimes.com/services/xml/rss/nyt/World.xml",homepage:"https://www.nytimes.com/section/world",licence:"personal use with attribution",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!0},{id:"wikinews-published",name:"Wikinews",kind:"contemporary",format:"mediawiki",url:"https://en.wikinews.org/w/api.php",homepage:"https://en.wikinews.org/",licence:"CC BY 2.5",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!0},{id:"simple-wikipedia",name:"Simple English Wikipedia",kind:"kb",format:"wikipedia-summary",url:"https://simple.wikipedia.org",homepage:"https://simple.wikipedia.org/",licence:"CC BY-SA 4.0",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!0},{id:"wikidata",name:"Wikidata",kind:"kb",format:"wikidata",url:"https://www.wikidata.org",homepage:"https://www.wikidata.org/",licence:"CC0 1.0",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!0},{id:"wiktionary",name:"Wiktionary",kind:"kb",format:"wiktionary",url:"https://en.wiktionary.org",homepage:"https://en.wiktionary.org/",licence:"CC BY-SA 3.0",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!0},{id:"dbpedia-lookup",name:"DBpedia Lookup",kind:"kb",format:"dbpedia-lookup",url:"https://lookup.dbpedia.org",homepage:"https://www.dbpedia.org/",licence:"CC BY-SA 3.0",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!1},{id:"english-wikipedia",name:"English Wikipedia",kind:"kb",format:"wikipedia-summary",url:"https://en.wikipedia.org",homepage:"https://en.wikipedia.org/",licence:"CC BY-SA 4.0",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!1}]),Fv=Object.freeze(["wikimedia-featured","hacker-news","usgs-quakes","nyt-world","wikinews-published"]),Dv=Object.freeze(["simple-wikipedia","wikidata","wiktionary"]),NH=new Map(Mv.map(e=>[e.id,e]))});var kt,PH,MH,FH,DH,zH,UH,BH,WH,GH,VH,HH,qH,KH,YH,XH,JH,QH,ZH,eq,wp=M(()=>{kt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},PH=kt("createRequire"),MH=kt("readFileSync"),FH=kt("access"),DH=kt("readFile"),zH=kt("writeFile"),UH=kt("appendFile"),BH=kt("mkdir"),WH=kt("mkdtemp"),GH=kt("rename"),VH=kt("unlink"),HH=kt("rm"),qH=kt("stat"),KH=kt("copyFile"),YH=kt("readdir"),XH=kt("createReadStream"),JH=kt("createWriteStream"),QH=kt("randomBytes"),ZH=kt("spawnSync"),eq=kt("createInterface")});var Uv=M(()=>{});var Bv=M(()=>{Lt();wp();Je();ea();Qc();lp();qe();Kt();Uv();it();el();cs()});var Xq,Jq,Qq,Zq,$p=M(()=>{it();Nv();Lv();It();cs();fl();Mn();zv();Qi();Br();Bv();Xq=Object.freeze({sources:Fv,kbSources:Dv,extraSources:Object.freeze([]),pollMinutes:15,enrichMinutes:10,enrichTermsPerCycle:3,negativeCacheTtlHours:24,syllogismsPerIngest:12,itemCap:30,newsFactCap:4e3,feedTop:3,windowHours:48,minIntervalMs:0}),Jq=6*36e5,Qq=Object.freeze({"simple-wikipedia":"simple-wikipedia",wikidata:"wikidata",wiktionary:"wiktionary","dbpedia-lookup":"dbpedia"}),Zq=ws.teach});var vp=M(()=>{it()});var HN,dK,Wv=M(()=>{Bo();al();ao();Je();vp();it();HN={},dK=ne(ye(qt(HN.url)),"..","..","..")});var pK,mK,hK,Gv=M(()=>{pK=Object.freeze(["task","autoFeedback","alloFeedback","turnManagement","timeManagement","discourseStructuring","ownCommunicationManagement","partnerCommunicationManagement","socialObligationsManagement","contactManagement"]),mK=Object.freeze({propositionalQuestion:Object.freeze({dimension:"task",gloss:"a yes/no question about whether a proposition holds ('does X import Y?')"}),checkQuestion:Object.freeze({dimension:"task",gloss:"a yes/no question whose asker already expects the answer yes ('..., right?')"}),setQuestion:Object.freeze({dimension:"task",gloss:"a wh-question asking for the members of a set ('what does X import?')"}),choiceQuestion:Object.freeze({dimension:"task",gloss:"a question asking which of the listed alternatives holds ('is X a module or a class?')"}),inform:Object.freeze({dimension:"task",gloss:"a declarative telling the addressee something (a teach turn; also tmct explaining its own function)"}),answer:Object.freeze({dimension:"task",gloss:"an inform that discharges a question just asked (an answer grounded in the graph)"}),confirm:Object.freeze({dimension:"task",gloss:"an answer 'yes' to a check question"}),disconfirm:Object.freeze({dimension:"task",gloss:"an answer 'no' to a check question"}),agreement:Object.freeze({dimension:"task",gloss:"an inform stating that the speaker holds what the addressee just stated to be true"}),disagreement:Object.freeze({dimension:"task",gloss:"an inform stating that the speaker holds what the addressee just stated to be false"}),correction:Object.freeze({dimension:"task",gloss:"a disagreement that also supplies the replacement ('no, I meant Y')"}),request:Object.freeze({dimension:"task",gloss:"asks the addressee to perform an action ('solve it' \u2014 a goal turn)"}),instruct:Object.freeze({dimension:"task",gloss:"a request the addressee is expected to carry out without negotiation (a bare imperative)"}),suggestion:Object.freeze({dimension:"task",gloss:"puts an action forward as advisable without claiming authority over the addressee"}),offer:Object.freeze({dimension:"task",gloss:"commits the speaker to an action, conditional on the addressee wanting it"}),autoPositive:Object.freeze({dimension:"autoFeedback",gloss:"the sender reports its own processing of the previous turn succeeded (an acknowledgement)"}),autoNegative:Object.freeze({dimension:"autoFeedback",gloss:"the sender reports its own processing of the previous turn failed \u2014 tmct's honest miss"}),initialGreeting:Object.freeze({dimension:"socialObligationsManagement",gloss:"opens an exchange of greetings ('hi')"}),returnGreeting:Object.freeze({dimension:"socialObligationsManagement",gloss:"answers a greeting with a greeting"}),thanking:Object.freeze({dimension:"socialObligationsManagement",gloss:"expresses gratitude for something the addressee did"}),apology:Object.freeze({dimension:"socialObligationsManagement",gloss:"expresses regret for something the speaker did"})}),hK=Object.freeze({teach:"inform","ask-set":"setQuestion","ask-propositional":"propositionalQuestion","ask-choice":"choiceQuestion",goal:"request",imperative:"instruct","honest-miss":"autoNegative",greeting:"initialGreeting",thanks:"thanking",help:"inform","game-answer":"answer","game-inform":"inform"})});var vK,KN,YN,Vv,xK,EK,SK,jK,kK,Hv=M(()=>{Sn();fl();vK=Object.freeze({inline:"inline",enumerated:"enumerated"}),KN=new Set(["in","on","at","for","with","from","of","into","onto"]),YN=new Set(["you","i","it","he","she","they","we","there","someone","something","one","him","her","them","who","himself","herself","itself","themselves","myself","yourself"]),Vv=new Set([...KN,"to","behind","before","near","next","along","alongside","under","over","between","among","during","without","about","by","as","like","that","if","when","while","being","because","since","until","so","and","but","or","immediately","likely","usually","normally","currently","is","are","was","were","do","does","did","has","have","had","will","would","could","should","might","must","can"]),xK=new Set([...Vv,"be","been"]),EK=new RegExp("^(?:in|at|on|from|by|with|for|of|to|off)\\s+(?:(?:what|which)\\s+[a-z][\\w'-]*|where|when|why|how|who)\\s+(?:is|are|was|were|do|does|did|can|could|should|would|will|has|have|might|must)\\s+(.+?)[?.!]*$","i"),SK=new RegExp("^(.*?)\\b(?:what|who|which|where|when|why|how)\\s+(?:i|you|he|she|it|we|they)?\\s*(?:is|are|was|were|do|does|did|can|could|should|would|will|has|have|might|must)\\b","i"),jK=Object.freeze([{family:"AtLocation",predicates:Object.freeze(["mgx:atLocation","mgx:locatedNear"]),cue:/\b(where|located|location)\b/i},{family:"IsA/Synonym/HasProperty",predicates:Object.freeze(["rdfs:subClassOf","mgx:synonym","mgx:hasProperty"]),cue:/\b(kind of|type of|another word for|same as|synonym)\b/i},{family:"HasPrerequisite/HasSubevent",predicates:Object.freeze(["mgx:hasPrerequisite","mgx:hasSubevent","mgx:hasFirstSubevent","mgx:hasLastSubevent"]),cue:/\b(before|after|first|next|then|once you|in order to)\b/i},{family:"Desires/MotivatedByGoal",predicates:Object.freeze(["mgx:desires","mgx:motivatedByGoal","mgx:causesDesire"]),cue:/\b(want\w*|desire\w*|motivat\w*)\b/i},{family:"Causes",predicates:Object.freeze(["mgx:causes","mgx:causesDesire"]),cue:/\b(cause\w*|result(?:s|ed)? in|leads? to|led to)\b/i},{family:"PartOf/HasA/MadeOf",predicates:Object.freeze(["mgx:partOf","mgx:hasA","mgx:madeOf"]),cue:/\b(part of|made of|has a|have a)\b/i},{family:"CapableOf",predicates:Object.freeze(["mgx:capableOf","mgxneg:capableOf"]),cue:/\b(capable of|able to)\b/i},{family:"UsedFor",predicates:Object.freeze(["mgx:usedFor"]),cue:/\b(used for|used to|use for)\b/i}]),kK=new Set([...YN,...Vv,"a","an","the","some","any","few","many","several","more","most","my","your","his","its","our","their","what","which","where","when","why","how","find","found","put","get","keep","store","place","buy","locate","hide","wear","carry","use","take","open","cross","need","want"])});function ta(e){let t=new Map;for(let[n,s]of e||[])!n||!s||n===s||(t.has(n)||t.set(n,new Set),t.get(n).add(s));return t}function pl(e,t,{cap:n=6,stopAt:s=null,toward:o=null}={}){let r=[e],i=new Set([e]),a=e;for(;r.length<n&&!(o&&a===o);){let c=[...t.get(a)||[]].filter(d=>!i.has(d)).sort(XN);if(!c.length)break;let l=o?c.filter(d=>d===o||Ep(d,t).has(o)):[];a=(l.length?l:c)[0];let u=s&&s.has(a);if(u&&r.length>1||(i.add(a),r.push(a),u))break}return r}function Ep(e,t,{cap:n=64}={}){let s=new Set([e]),o=[e];for(;o.length&&s.size<n;){let r=o.shift();for(let i of t.get(r)||[])s.has(i)||(s.add(i),o.push(i))}return s}function Sp(e,t,n,s){if(n.has(e))return n.get(e);if(s.has(e))return 1;s.add(e);let o=t.get(e),r=1;if(o&&o.size){let i=0;for(let a of o)i=Math.max(i,Sp(a,t,n,s));r=i+1}return s.delete(e),n.set(e,r),r}function JN(e){let t=new Map;for(let[n,s]of e||[])!n||!s||(t.has(n)||t.set(n,new Set),t.get(n).add(s),t.has(s)||t.set(s,new Set),t.get(s).add(n));return t}function QN(e,t,n,s,o,{threshold:r,rootDepth:i,icByTerm:a}){let c=Ep(e,n),l=Ep(t,n);if(c.has(t)||l.has(e))return{distinct:!1,reason:"subsumes",lcs:c.has(t)?t:e};if(s.size)for(let h of c){let g=s.get(h);if(g){for(let b of l)if(g.has(b))return{distinct:!0,reason:"disjoint",lcs:null}}}let u=[...c].filter(h=>l.has(h));if(!u.length)return c.size<2||l.size<2?{distinct:!1,reason:"inconclusive",lcs:null}:{distinct:!0,reason:"non-intersecting",lcs:null};let d=h=>Sp(h,n,o,new Set),p=u[0],f=d(p);for(let h of u){let g=d(h);(g>f||g===f&&h<p)&&(p=h,f=g)}if(f<=i)return{distinct:!0,reason:"root-subsumer",lcs:p};if(a){let h=a.get(p);return typeof h=="number"&&h<r?{distinct:!0,reason:"low-ic",lcs:p}:{distinct:!1,reason:"shared-lineage",lcs:p}}return 2*f/(d(e)+d(t))<r?{distinct:!0,reason:"shallow-subsumer",lcs:p}:{distinct:!1,reason:"shared-lineage",lcs:p}}function ml(e,{subClassEdges:t=[],parents:n=null,disjointEdges:s=[],threshold:o=.5,rootDepth:r=1,icByTerm:i=null}={}){let a=[...new Set((e||[]).filter(Boolean))],c=n||ta(t),l=JN(s),u=new Map,d=new Map(a.map(y=>[y,y])),p=y=>{for(;d.get(y)!==y;)d.set(y,d.get(d.get(y))),y=d.get(y);return y},f=(y,$)=>{let E=p(y),_=p($);E!==_&&d.set(E<_?_:E,E<_?E:_)},m=[];for(let y=0;y<a.length;y+=1)for(let $=y+1;$<a.length;$+=1){let E=QN(a[y],a[$],c,l,u,{threshold:o,rootDepth:r,icByTerm:i});m.push({a:a[y],b:a[$],...E}),E.distinct||f(a[y],a[$])}let h=new Map;for(let y of a){let $=p(y);h.has($)||h.set($,[]),h.get($).push(y)}let g=y=>Sp(y,c,u,new Set),b=[...h.values()].map(y=>{let $=[...y].sort(),E=$[0],_=g(E);for(let v of $){let S=g(v);S>_&&(_=S,E=v)}return{objects:$,label:E}}).sort((y,$)=>y.label.localeCompare($.label));return{split:b.length>1,clusters:b,pairs:m}}var XN,hl=M(()=>{It();Zi();XN=(e,t)=>e<t?-1:e>t?1:0});function jp(e){return typeof e=="string"&&ZN.test(e)}function qv(e){return!!e&&typeof e=="object"&&Wo(e.s)}function kp(e){return!!e&&typeof e=="object"&&e.kind==="fact"&&jp(e.world)&&Wo(e.subject)&&Wo(e.predicate)&&Wo(e.object)}function Rp(e){if(!e||typeof e!="object"||e.kind!=="rule"||!jp(e.world)||!Wo(e.name)||!tL.has(e.ruleKind)||!e.slots||typeof e.slots!="object"||Array.isArray(e.slots))return!1;let t=Object.values(e.slots);return t.length>0&&t.every(Wo)}function _p(e){return!!e&&typeof e=="object"&&e.kind==="meta"&&jp(e.world)&&Wo(e.opening)}function Kv(e){return kp(e)||Rp(e)||_p(e)}function Yv(e){let t=e||[],n=t.filter(l=>l.predicate===nL).sort((l,u)=>`${l.subject}\0${l.object}`.localeCompare(`${u.subject}\0${u.object}`));if(!n.length)return t;let s=new Set(t.filter(l=>l.predicate==="rdf:type").map(l=>l.subject)),o=new Map;for(let l of t)l.predicate==="mgx:located-in"&&o.set(l.subject,l.object);let r=(l,u)=>t.some(d=>d.predicate==="rdf:type"&&d.object===l&&o.get(d.subject)===u),i=t.find(l=>typeof l.world=="string"&&l.kind==="fact"),a=(l,u,d)=>({...i?{world:i.world,kind:"fact"}:{},subject:l,predicate:u,object:d}),c=[];for(let l of n){let u=l.subject,d=l.object;if(r(d,u))continue;let p=d,f=1;for(;s.has(p);)f+=1,p=`${d}-${f}`;s.add(p),c.push(a(p,"rdf:type",d)),c.push(a(p,"rdf:type","portable")),c.push(a(p,"mgx:located-in",u))}return c.length?[...t,...c]:t}var ZN,eL,tL,Wo,nL,Go=M(()=>{ZN=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,eL=Object.freeze(["action-signature","action-precond","action-effect","action-constraint"]),tL=new Set(eL),Wo=e=>typeof e=="string"&&e.trim()!=="";nL="mgx:default-contains"});var sL,oL,IK,na=M(()=>{sL=Object.freeze(["mgx:consumes","mgx:display-name","mgx:evades","mgx:guards","mgx:hasMass","mgx:is-predator","mgx:mass-drain-per-turn","mgx:model","mgx:pursues","mgx:vision-radius"]),oL=Object.freeze(new Set(["mgx:consumes","mgx:evades","mgx:guards","mgx:pursues"])),IK=Object.freeze(["mgx:consumes","mgx:evades","mgx:pursues"])});var gl=M(()=>{});var rL,iL,aL,cL,lL,uL,dL,fL,pL,mL,hL,gL,bL,wL,yL,$L,vL,xL,EL,MK,SL,Xv,FK,DK,Jv=M(()=>{cs();fr();rL="subClassOf",iL="typeAssertion",aL="relation",cL="someValuesFrom",lL="cardinality",uL="disjointWith",dL="possessive",fL="adjective",pL="capability",mL="union",hL="complement",gL="negativeType",bL="enumeration",wL="differentFrom",yL="bareExistential",$L="transitiveRole",vL="inverseRole",xL="universal",EL="subPropertyOf",MK=Object.freeze([rL,iL,aL,cL,lL,uL,dL,fL,pL,mL,hL,gL,bL,wL,yL,$L,vL,xL,EL]),SL=new Set(["go","take","drop","open","unlock","close","give","look","talk","examine","dig","eat","put"]),Xv=new Map([["pick up","take"],["pick","take"],["grab","take"],["put down","drop"],["set down","drop"],["leave","drop"],["talk to","talk"],["speak to","talk"],["speak with","talk"],["talk","talk"],["speak","talk"],["chat with","talk"],["converse with","talk"],["look at","examine"],["examine","examine"],["inspect","examine"],["have a look at","examine"],["take a look at","examine"],["check out","examine"],["shut","close"]]),FK=Math.max(...[...Xv.keys()].map(e=>e.split(" ").length)),DK=[...new Set([...SL,...[...Xv.keys()].map(e=>e.split(" ")[0])])]});var Vo=M(()=>{});var Tp=M(()=>{De();Jn();Vo()});function Bt({name:e,label:t,question:n,params:s=[],preconditions:o=[],add:r=[],del:i=[]}){return Object.freeze({type:co.Capability,name:e,label:t,question:n,readOnly:!0,parameters:Object.freeze(s),preconditions:Object.freeze(o),effects:Object.freeze({add:Object.freeze(r),del:Object.freeze(i)})})}var jL,co,Ee,kL,Ho,mt,Jt,ln,RL,Qv,Ut,_L,TL,Zv,HK,qK,KK,Wr=M(()=>{jL=Object.freeze({cap:"urn:tmct:cap#",taught:"urn:tmct:taught#",mgx:"urn:tmct:mgx#",seon:"http://se-on.org/ontologies/seon.owl#"}),co=Object.freeze({Capability:"cap:Capability",Parameter:"cap:Parameter",Precondition:"cap:Precondition",Effect:"cap:Effect"}),Ee=Object.freeze({Symbol:"seon:CodeEntity",Module:"mgx:Module",Class:"seon:ClassType",MemoryTerm:"mgx:MemoryTerm",Query:"cap:FreeText",Kind:"cap:KindFilter",Package:"cap:PackageName"}),kL=Object.freeze([Ee.MemoryTerm]),Ho=Object.freeze({graphLoaded:"cap:graph-loaded",resolves:"cap:resolves",anyPresent:"cap:any-present",memoryFacts:"cap:memory-facts"}),mt=(e,t,{arg:n=e,required:s=!0,note:o=""}={})=>Object.freeze({type:co.Parameter,name:e,kind:t,arg:n,required:s,note:o}),Jt=()=>Object.freeze({type:co.Precondition,pred:Ho.graphLoaded}),ln=(e,t)=>Object.freeze({type:co.Precondition,pred:Ho.resolves,param:e,as:t}),RL=e=>Object.freeze({type:co.Precondition,pred:Ho.anyPresent,params:Object.freeze([...e])}),Qv=()=>Object.freeze({type:co.Precondition,pred:Ho.memoryFacts}),Ut=(e,t=null)=>Object.freeze({type:co.Effect,pred:"cap:knows",topic:e,of:t?`?${t}`:null});_L=Object.freeze([Bt({name:"tmct_search",label:"search",question:"lexical search across the graph",params:[mt("query",Ee.Query,{required:!1,note:"required unless a kind filter is given"}),mt("kind",Ee.Kind,{required:!1}),mt("name",Ee.Query,{required:!1}),mt("decorator",Ee.Query,{required:!1})],preconditions:[Jt(),RL(["query","kind"])],add:[Ut("matches","query")]}),Bt({name:"tmct_describe",label:"describe",question:"a symbol's definition, kind and relations",params:[mt("symbol",Ee.Symbol)],preconditions:[Jt(),ln("symbol",Ee.Symbol)],add:[Ut("description","symbol")]}),Bt({name:"tmct_signature",label:"signature",question:"a symbol's signature only",params:[mt("symbol",Ee.Symbol)],preconditions:[Jt(),ln("symbol",Ee.Symbol)],add:[Ut("signature","symbol")]}),Bt({name:"tmct_impact",label:"impact",question:"what a change to this module or symbol reaches (impact closure)",params:[mt("module",Ee.Symbol,{note:"a Module, or any sited symbol \u2014 a fine-grained seed walks callsSymbol dependents and coarsens them to module grain"})],preconditions:[Jt(),ln("module",Ee.Symbol)],add:[Ut("impact","module")]}),Bt({name:"tmct_members",label:"members",question:"the methods/attributes of a class",params:[mt("class",Ee.Class,{arg:"class"})],preconditions:[Jt(),ln("class",Ee.Class)],add:[Ut("members","class")]}),Bt({name:"tmct_subclasses",label:"subclasses",question:"the subclasses of a class",params:[mt("class",Ee.Class,{arg:"class"})],preconditions:[Jt(),ln("class",Ee.Class)],add:[Ut("subclasses","class")]}),Bt({name:"tmct_exports",label:"exports",question:"a module's public exports",params:[mt("module",Ee.Module)],preconditions:[Jt(),ln("module",Ee.Module)],add:[Ut("exports","module")]}),Bt({name:"tmct_callers",label:"callers",question:"functions that call this symbol",params:[mt("symbol",Ee.Symbol)],preconditions:[Jt(),ln("symbol",Ee.Symbol)],add:[Ut("callers","symbol")]}),Bt({name:"tmct_callees",label:"callees",question:"functions this symbol calls",params:[mt("symbol",Ee.Symbol)],preconditions:[Jt(),ln("symbol",Ee.Symbol)],add:[Ut("callees","symbol")]}),Bt({name:"tmct_calls",label:"calls",question:"the call edges out of this symbol/module",params:[mt("symbol",Ee.Symbol)],preconditions:[Jt(),ln("symbol",Ee.Symbol)],add:[Ut("calls","symbol")]}),Bt({name:"tmct_tests_for",label:"tests",question:"the tests covering this symbol",params:[mt("symbol",Ee.Symbol)],preconditions:[Jt(),ln("symbol",Ee.Symbol)],add:[Ut("tests","symbol")]}),Bt({name:"tmct_untested",label:"untested",question:"symbols with no covering test",params:[],preconditions:[Jt()],add:[Ut("untested",null)]}),Bt({name:"tmct_history",label:"history",question:"the commit history of this symbol",params:[mt("symbol",Ee.Symbol)],preconditions:[Jt(),ln("symbol",Ee.Symbol)],add:[Ut("history","symbol")]}),Bt({name:"tmct_cochanges",label:"cochanges",question:"symbols that change together with this one",params:[mt("symbol",Ee.Symbol)],preconditions:[Jt(),ln("symbol",Ee.Symbol)],add:[Ut("cochanges","symbol")]}),Bt({name:"tmct_architecture",label:"arch",question:"the architecture overview (optional package filter)",params:[mt("package",Ee.Package,{required:!1})],preconditions:[Jt()],add:[Ut("architecture","package")]}),Bt({name:"tmct_related",label:"related",question:"a term's synonyms and related concepts (the SKOS view over the conversational-memory graph)",params:[mt("term",Ee.MemoryTerm,{note:"a concept term, matched against memory relation facts rather than resolved in the code graph"})],preconditions:[Qv(),ln("term",Ee.MemoryTerm)],add:[Ut("related","term")]}),Bt({name:"tmct_sprite",label:"sprite",question:"the sprite for a class, with the expression and size asked for",params:[mt("class",Ee.MemoryTerm,{arg:"class",note:"a world class, matched against the memory graph's own fact rows rather than resolved in the code graph"}),mt("expression",Ee.Kind,{required:!1,note:"one of sprite-expressions.mjs's palette words, carried as an mgx:feels fact"}),mt("size",Ee.Kind,{required:!1,note:"a taught mgx:hasProperty size word, resolved to a render scale \u2014 not a template tier"})],preconditions:[Qv(),ln("class",Ee.MemoryTerm)],add:[Ut("sprite","class")]})]),TL=e=>Object.freeze(e.reduce((t,n)=>(t[n.name]=n,t),Object.create(null))),Zv=_L,HK=TL(Zv),qK=Object.freeze({tmct_context:"unbounded edit-context bundle (multi-file); needs a size/budget precondition",tmct_context_more:"unbounded context continuation; same as tmct_context",tmct_snippet:"raw source-file read (reads the filesystem); needs a file-read + span precondition",tmct_ask:"the plain-English question entry point itself \u2014 calls ask.mjs directly and bypasses the capability planner; not one of the planner's operators",tmct_export:"reads the memory store's whole fact set with no discriminating param and no resolver goal frame; needs NL-reachability wiring before it can join",tmct_ingest:"writes into the memory store (grounds facts); capability() only models read-only operators, so a write path needs its own precondition/effect design first",tmct_file_history:"a module-grain cut of the same history edge tmct_history already models; no NL frame distinguishes the granularities yet",tmct_method_history:"a method-grain cut of the same history edge tmct_history already models; no NL frame distinguishes the granularities yet",tmct_class_history:"a class-grain cut of the same history edge tmct_history already models; no NL frame distinguishes the granularities yet"}),KK=Object.freeze({prefixes:jL,vocab:co,kinds:Ee,precond:Ho,get capabilities(){return Zv}})});var Ap=M(()=>{Wr()});var bl=M(()=>{Mn()});var Cp=M(()=>{Wr()});function NL(e){let t={};for(let n of String(e).toLowerCase().match(/[a-z]+/g)||[])!t.expression&&Object.hasOwn(Hs,n)&&(t.expression=n),!t.size&&Wi([{predicate:OL,object:n}])!==1&&(t.size=n);return t}var gY,bY,wY,yY,OL,$Y,Ip=M(()=>{Jn();Kn();Wc();it();De();$a();Xf();Wr();Cp();gY=new RegExp(`\\b(?:${Object.keys(Hn).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s+")).join("|")})\\b`,"i"),bY=Object.freeze({"reverse:calls":{topic:"callers",arg:"symbol"},"forward:calls":{topic:"callees",arg:"symbol"},"reverse:tests":{topic:"tests",arg:"symbol"},"forward:tests":{topic:"tests",arg:"symbol"},"reverse:inherits":{topic:"subclasses",arg:"class"},"forward:reexports":{topic:"exports",arg:"module"},"forward:contains":{topic:"members",arg:"class"},"when:touches":{topic:"history",arg:"symbol"},"forward:cochange":{topic:"cochanges",arg:"symbol"},"reverse:cochange":{topic:"cochanges",arg:"symbol"}}),wY=Object.freeze({imports:"no importer/imports query tool in the registry (there is no tmct_imports); refusing beats mis-routing to calls",uses:"a query-side UNION (imports+calls+callsSymbol) with no single capability; a router that must emit ONE call cannot honour it \u2014 refuse",defines:"Module->symbol `defines` has no dedicated capability (tmct_members is Class-scoped `contains`); refuse rather than answer a different grain",serves:"a provider-declared edge with no capability in the registry; the ask lane traverses it directly, so refusing here beats mis-routing to a code-grain tool",denotes:"a provider-declared edge with no capability in the registry; the ask lane traverses it directly, so refusing here beats mis-routing to a code-grain tool"}),yY=Object.freeze({}),OL="mgx:hasProperty";$Y=Object.freeze([{re:/\buntested\b|\bwithout\s+(?:a\s+)?tests?\b|\bhas\s+no\s+tests?\b|\bneeds?\s+(?:a\s+)?tests?\b/i,topic:"untested",noArg:!0,skipIfSuperlative:!0},{re:/\bblast\s*radius\b|\bimpacts?\b|\bimpacted\b|what\s+(?:a\s+)?change.*(?:reach|affect|touch)|what\s+(?:depends?\s+on|dependents?)\b/i,topic:"impact",arg:"module"},{re:/\bcall[\s-]*edges?\b|\bcall[\s-]*graph\b|\boutgoing\s+calls?\b|\bcall[\s-]*sites?\s+(?:of|in|out|from)\b/i,topic:"calls",arg:"symbol"},{re:/\bcallees?\b|wh(?:at|o)\s+does\s+\S+\s+call\b/i,topic:"callees",arg:"symbol"},{re:/\bcallers?\b|who\s+calls\b|what\s+calls\b/i,topic:"callers",arg:"symbol"},{re:/\btests?\b.*\b(?:for|cover|covering|of)\b|which\s+tests?\b|covers?\b|covered\b|test\s+coverage\b/i,topic:"tests",arg:"symbol"},{re:/\bcochang|change[- ]coupl/i,topic:"cochanges",arg:"symbol"},{re:/\bexports?\b|\bpublic\s+api\b/i,topic:"exports",arg:"module"},{re:/\bsubclasses?\b|children\s+of\b|\bextends?\b/i,topic:"subclasses",arg:"class"},{re:/\bmembers?\b|\bmethods?\s+of\b|\battributes?\s+of\b/i,topic:"members",arg:"class"},{re:/\bhistory\b|who\s+changed\b|commits?\s+(?:that\s+)?touch/i,topic:"history",arg:"symbol"},{re:/\bsignature\b/i,topic:"signature",arg:"symbol"},{re:/\bsynonyms?\b|\banother\s+word\s+for\b|\brelated\s+(?:words?|concepts?|to)\b/i,topic:"related",arg:"term"},{re:/\bsprite\b|\bicon\b|\bavatar\b|\bpicture\s+of\b|\bwhat\s+does\s+.+\s+look\s+like\b/i,topic:"sprite",arg:"class",slots:NL},{re:/\bdescribe\b|\bexplain\b|what\s+is\b|tell\s+me\s+about\b|definition\s+of\b/i,topic:"description",arg:"symbol"},{re:/\bsearch\b|\bfind\b|look\s+for\b/i,topic:"matches",arg:"query"}])});var nx=M(()=>{});var PL,sx=M(()=>{Ip();Wr();Cp();nx();Jn();PL=Object.freeze([Object.freeze({id:"coverage-invariant",kind:"maintenance",invariant:"an impactful module must be tested",focusClass:"Module",modes:Object.freeze(["scoped","global"]),subGoals:Object.freeze(["impact","untested"]),priorityTopic:"impact",coverageTopic:"untested",compose:Object.freeze({op:"intersect",a:Object.freeze({topic:"untested"}),b:Object.freeze({topic:"impact",of:"focus",withFocus:!0}),names:"the change's untested footprint",empty:"no coverage gap"}),achieves:"coverage-gap"}),Object.freeze({id:"cochange-risk-invariant",kind:"maintenance",invariant:"a module change-coupled with the focus must be tested",focusClass:"Module",modes:Object.freeze(["scoped"]),subGoals:Object.freeze(["cochanges","untested"]),priorityTopic:"cochanges",coverageTopic:"untested",compose:Object.freeze({op:"intersect",a:Object.freeze({topic:"cochanges",of:"focus"}),b:Object.freeze({topic:"untested"}),names:"the change-coupled untested set",empty:"every change-coupled module is tested"}),achieves:"cochange-risk"})])});var wl=M(()=>{gl();bl();Ip();sx();Wr();Ap()});function DL(e=process.env){return e?.TMCT_WORLDS_PACK_DIR||ne(FL,"corpus","worlds")}function ox(e){try{return il(Fr(e))}catch{return null}}function rx(e){if(Np.has(e))return Np.get(e);let t=null,n=ox(ne(e,"index.json.gz"));if(n)try{let s=JSON.parse(n.toString("utf8"));s&&typeof s=="object"&&!Array.isArray(s)&&(t=s)}catch{}return Np.set(e,t),t}function zL(e,t){let n=rx(e);if(!n)return null;let s=n[String(t??"")];if(!qv(s))return null;let o=`${e}\0${t}`;if(Lp.has(o))return Lp.get(o);let r=null,i=ox(ne(e,"shards",`${s.s}.jsonl.gz`));if(i){let a=[],c=[],l=null;for(let u of i.toString("utf8").split(`
167
- `))if(u.trim())try{let d=JSON.parse(u);if(!Kv(d)||d.world!==t)continue;kp(d)?a.push(d):Rp(d)?c.push(d):_p(d)&&!l&&(l=d)}catch{}(a.length||c.length||l)&&(r={name:t,facts:Yv(a),rules:c,meta:l})}return Lp.set(o,r),r}var BL,FL,Np,Lp,UL,GY,yl=M(()=>{Bo();al();ao();Je();Go();BL={},FL=ne(ye(qt(BL.url)),"..","..","..");Np=new Map,Lp=new Map;UL=e=>({list:async()=>{let t=rx(e());return t?Object.keys(t).sort():null},load:async t=>zL(e(),t)}),GY=UL(()=>DL())});var ZY,ix=M(()=>{Lt();Je();qs();si();Mn();qe();ZY=ne(".tmct","memory","blocks")});var ax=M(()=>{Vo()});var lx=M(()=>{qs();si();Vo()});var Pp=M(()=>{qs();si();Vo()});var ux=M(()=>{Pp();qs();ys();Vo()});var dx=M(()=>{});var fx=M(()=>{ax();lx();Pp();ux();dx();Vo()});var px=M(()=>{ix();qe();tc();Qc();fx();Tp()});function Gr(e,t){let n=parseInt(e.slice(1),16);return`rgba(${n>>16&255}, ${n>>8&255}, ${n&255}, ${t})`}function vl(e){let t=n=>HL.map((s,o)=>`--${n}-t${o+1}: ${Gr(e[n],s)};`).join(" ");return[`--bg: ${e.bg}; --ink: ${e.ink}; --muted: ${e.muted}; --line: ${e.line}; --card: ${e.card};`,`--taught: ${e.taught}; --corpus: ${e.corpus}; --entail: ${e.entail}; --alert: ${e.alert};`,t("taught"),t("corpus"),t("entail"),`--taught-soft: ${Gr(e.taught,.12)}; --corpus-soft: ${Gr(e.corpus,.12)};`,`--entail-soft: ${Gr(e.entail,.14)}; --alert-soft: ${Gr(e.alert,.12)};`,`--sprite-pop: drop-shadow(0 0 .6px ${Gr(e.ink,e.popRimAlpha)}) drop-shadow(${e.popShadow});`].join(" ")}var $l,HL,V3,Mp=M(()=>{fl();$l=Object.freeze({light:Object.freeze({bg:"#F7F6F2",ink:"#23272B",muted:"#6E7168",line:"#DDD9D0",card:"#FFFFFF",taught:"#2E7D4F",corpus:"#5A80AC",entail:"#B07C2E",alert:"#B0503F",popRimAlpha:.66,popShadow:"0 1px 1.2px rgba(0, 0, 0, .30)"}),dark:Object.freeze({bg:"#15181C",ink:"#E7E5DF",muted:"#9A9E95",line:"#2B3036",card:"#1C2126",taught:"#5FBE8B",corpus:"#6C93BF",entail:"#D9A554",alert:"#D08070",popRimAlpha:.45,popShadow:"0 1px 1.4px rgba(0, 0, 0, .55)"})}),HL=[.35,.65,1];V3=`
168
- :root { color-scheme: light dark; ${vl($l.light)} }
169
- @media (prefers-color-scheme: dark) { :root { ${vl($l.dark)} } }
170
- :root[data-theme="dark"] { ${vl($l.dark)} }
171
- :root[data-theme="light"] { ${vl($l.light)} }
172
- `});var mx=M(()=>{Mp()});var hx=M(()=>{Mp()});var bx=M(()=>{qe();Go();Sn();Vr()});var yx=M(()=>{ys();qe();gl();wl();Vr()});var Dp,e0,t0,n0,s0,o0,r0,W5,G5,Vr=M(()=>{Go();na();gl();Jv();cs();qc();Tp();Ap();wl();bl();yl();qe();px();mx();hx();bx();yx();Dp="mgx:world-epoch",e0=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:hidden-in"]),t0=new Set(["mgx:on-top-of","mgx:on-plane","mgx:under"]),n0="mgx:is-open",s0="mgx:hasMass",o0="mgx:knows-about",r0="mgx:display-name",W5=new Set([...e0,...t0,n0,s0,o0,r0,"rdf:type",Dp]),G5=new RegExp("^(?:what\\s+foods?\\s+(?:do\\s+you\\s+know(?:\\s+about)?|have\\s+you\\s+(?:found|seen|heard\\s+(?:about|of))|do\\s+you\\s+know\\s+of)|what\\s+do\\s+you\\s+know\\s+about\\s+(?:any\\s+)?foods?|do\\s+you\\s+know\\s+(?:about|of)\\s+(?:any\\s+)?foods?|where\\s+is\\s+(?:the\\s+)?food)[?.!\\s]*$","i")});var Hr,H5,q5,K5,Y5,X5,J5,lo=M(()=>{Hr=Object.freeze({spiderFly:Object.freeze({spiderInitialMass:15,spiderMassDecrementPerTurn:.5,flyInitialMass:10,flyMassDecrementPerTurn:1,spiderVisionRadius:4,flyVisionRadius:4,eggHatchDelayTurns:3,flySpawnIntervalTurns:3,eggLayMassThreshold:25,eggHatchCount:2,minHatchlingMass:3,webDurationTurns:10}),mud:Object.freeze({moleInitialMass:8,moleMassDecrementPerTurn:.06,moleSpeed:1,moleDigReach:1,voleInitialMass:6,voleMassDecrementPerTurn:.05,voleSpeed:1,voleDigReach:1,badgerInitialMass:20,badgerMassDecrementPerTurn:.08,badgerSpeed:2,badgerDigReach:2,groundhogInitialMass:12,groundhogMassDecrementPerTurn:.06,groundhogSpeed:2,groundhogDigReach:2,meerkatInitialMass:9,meerkatMassDecrementPerTurn:.05,meerkatSpeed:1,meerkatDigReach:1}),mudiii:Object.freeze({predatorInitialMass:20,predatorMassDecrementPerTurn:.08,predatorVisionRadius:4,preyInitialMass:8,preyMassDecrementPerTurn:.06,preyVisionRadius:3,preySpawnIntervalTurns:5,foodSpawnIntervalTurns:3,spawnedFoodMass:2,placedFoodMass:2,maxPreyPopulation:6,maxFoodItems:8,foodVisionGated:!0,blendPreyDecision:!1,preyThreatWeight:.5,teach:!1}),guessNumber:Object.freeze({defaultLo:1,defaultHi:100,maxBound:1e9}),adventure:Object.freeze({teach:!1}),planning:Object.freeze({maxDepth:300})}),H5=Object.freeze({spider_initial_mass:"spiderInitialMass",spider_mass_decrement_per_turn:"spiderMassDecrementPerTurn",fly_initial_mass:"flyInitialMass",fly_mass_decrement_per_turn:"flyMassDecrementPerTurn",spider_vision_radius:"spiderVisionRadius",fly_vision_radius:"flyVisionRadius",egg_hatch_delay_turns:"eggHatchDelayTurns",fly_spawn_interval_turns:"flySpawnIntervalTurns",egg_lay_mass_threshold:"eggLayMassThreshold",egg_hatch_count:"eggHatchCount",min_hatchling_mass:"minHatchlingMass",web_duration_turns:"webDurationTurns"}),q5=Object.freeze({mole_initial_mass:"moleInitialMass",mole_mass_decrement_per_turn:"moleMassDecrementPerTurn",mole_speed:"moleSpeed",mole_dig_reach:"moleDigReach",vole_initial_mass:"voleInitialMass",vole_mass_decrement_per_turn:"voleMassDecrementPerTurn",vole_speed:"voleSpeed",vole_dig_reach:"voleDigReach",badger_initial_mass:"badgerInitialMass",badger_mass_decrement_per_turn:"badgerMassDecrementPerTurn",badger_speed:"badgerSpeed",badger_dig_reach:"badgerDigReach",groundhog_initial_mass:"groundhogInitialMass",groundhog_mass_decrement_per_turn:"groundhogMassDecrementPerTurn",groundhog_speed:"groundhogSpeed",groundhog_dig_reach:"groundhogDigReach",meerkat_initial_mass:"meerkatInitialMass",meerkat_mass_decrement_per_turn:"meerkatMassDecrementPerTurn",meerkat_speed:"meerkatSpeed",meerkat_dig_reach:"meerkatDigReach"}),K5=Object.freeze({predator_initial_mass:"predatorInitialMass",predator_mass_decrement_per_turn:"predatorMassDecrementPerTurn",predator_vision_radius:"predatorVisionRadius",prey_initial_mass:"preyInitialMass",prey_mass_decrement_per_turn:"preyMassDecrementPerTurn",prey_vision_radius:"preyVisionRadius",prey_spawn_interval_turns:"preySpawnIntervalTurns",food_spawn_interval_turns:"foodSpawnIntervalTurns",spawned_food_mass:"spawnedFoodMass",placed_food_mass:"placedFoodMass",max_prey_population:"maxPreyPopulation",max_food_items:"maxFoodItems",food_vision_gated:"foodVisionGated",blend_prey_decision:"blendPreyDecision",prey_threat_weight:"preyThreatWeight",teach:"teach"}),Y5=Object.freeze({teach:"teach"}),X5=Object.freeze({default_lo:"defaultLo",default_hi:"defaultHi",max_bound:"maxBound"}),J5=Object.freeze({max_depth:"maxDepth"})});var xx,i0,El,a0,c0,Ex,Sx,l0,u0,e4,d0,f0,jx=M(()=>{lo();xx="spider-fly",i0=10,El=Object.freeze({x:2,y:2}),a0=1,c0=Object.freeze({predator:Object.freeze({role:"predator",kind:"spider",idPrefix:"spider",hunts:"prey"}),prey:Object.freeze({role:"prey",kind:"fly",idPrefix:"fly",hunts:null}),food:null}),Ex=(e,t)=>`cell-${e}-${t}`,Sx=(e,t,n,s)=>Math.max(Math.abs(e-n),Math.abs(t-s)),l0=(e,t)=>Sx(e,t,El.x,El.y)<=a0,u0=Object.freeze({north:Object.freeze({dx:0,dy:-1}),south:Object.freeze({dx:0,dy:1}),east:Object.freeze({dx:1,dy:0}),west:Object.freeze({dx:-1,dy:0})}),e4=Object.freeze([Object.freeze(["poodle","dog"]),Object.freeze(["sheepdog","dog"]),Object.freeze(["dog","animal"]),Object.freeze(["spider","arachnid"]),Object.freeze(["arachnid","animal"]),Object.freeze(["fly","insect"]),Object.freeze(["insect","animal"])]),d0="a spider waits in its web; a fly drifts in from the edge of the board. Neither is yours to move. Watch, or address one by name in chat.",f0=Object.freeze({name:xx,gridSize:i0,opening:d0,boardNoun:"board",boardSubject:"board",cast:Object.freeze({predators:1,prey:1}),props:Object.freeze([]),staticWebAt:l0,webHomeCell:Ex(El.x,El.y)})});var kx,Ax,s4,o4,r4,zp,Rx,_x,Tx,Up,i4,a4,Sl=M(()=>{lo();kx=Object.freeze({predator:"fox",prey:"goblin",spawnedFood:"crumb",placedFood:"morsel"}),Ax=Object.freeze({north:Object.freeze({dx:0,dy:-1}),south:Object.freeze({dx:0,dy:1}),east:Object.freeze({dx:1,dy:0}),west:Object.freeze({dx:-1,dy:0})}),s4=Object.freeze(["north","northeast","east","southeast","south","southwest","west","northwest"]),o4=Object.freeze(["blacksmith","bush","cart","fence","house","inn","oak","stall","well"]),r4=Object.freeze([kx.spawnedFood,kx.placedFood]),zp=e=>Object.freeze({...e,props:Object.freeze(e.props.map(t=>Object.freeze(t))),cast:Object.freeze(e.cast)}),Rx=zp({name:"town-square",gridSize:12,opening:"a fox prowls the town square; goblins pick over the stalls for scraps. Neither is yours to move. Watch, or address one by name in chat.",cast:{predators:1,prey:3},props:[{id:"house-1",model:"house-1",cell:"cell-8-1",rotation:"180"},{id:"house-2",model:"house-2",cell:"cell-8-2",rotation:"180"},{id:"house-3",model:"house-3",cell:"cell-8-3",rotation:"180"},{id:"well-1",model:"well",cell:"cell-6-7",rotation:"0"},{id:"stall-1",model:"market-stall-1",cell:"cell-3-9",rotation:"90"},{id:"inn-1",model:"inn",cell:"cell-11-10",rotation:"270"}]}),_x=zp({name:"town-square-market",gridSize:10,opening:"market day in the town square: two rows of stalls, goblins working the lanes between them, and a fox somewhere among the crowd.",cast:{predators:1,prey:4},props:[{id:"stall-1",model:"market-stall-1",cell:"cell-2-4",rotation:"0"},{id:"stall-2",model:"market-stall-2",cell:"cell-3-4",rotation:"0"},{id:"stall-3",model:"market-stall-1",cell:"cell-4-4",rotation:"0"},{id:"stall-4",model:"market-stall-2",cell:"cell-6-4",rotation:"0"},{id:"stall-5",model:"market-stall-1",cell:"cell-7-4",rotation:"0"},{id:"stall-6",model:"market-stall-2",cell:"cell-8-4",rotation:"0"},{id:"stall-7",model:"market-stall-2",cell:"cell-2-7",rotation:"180"},{id:"stall-8",model:"market-stall-1",cell:"cell-3-7",rotation:"180"},{id:"stall-9",model:"market-stall-2",cell:"cell-4-7",rotation:"180"},{id:"stall-10",model:"market-stall-1",cell:"cell-6-7",rotation:"180"},{id:"stall-11",model:"market-stall-2",cell:"cell-7-7",rotation:"180"},{id:"stall-12",model:"market-stall-1",cell:"cell-8-7",rotation:"180"},{id:"well-1",model:"well",cell:"cell-5-5",rotation:"0"},{id:"blacksmith-1",model:"blacksmith",cell:"cell-10-5",rotation:"270"},{id:"cart-1",model:"cart",cell:"cell-1-1",rotation:"90"},{id:"cart-2",model:"cart",cell:"cell-10-10",rotation:"270"},{id:"bush-1",model:"bush",cell:"cell-10-1",rotation:"0"},{id:"bush-2",model:"bush",cell:"cell-1-10",rotation:"0"}]}),Tx=zp({name:"town-square-chapel",gridSize:14,opening:"the chapel corner of the town square, fenced to the south and shaded by three oaks. Two foxes hunt here, and two goblins know it.",cast:{predators:2,prey:2},props:[{id:"inn-1",model:"inn",cell:"cell-2-2",rotation:"180"},{id:"house-1",model:"house-1",cell:"cell-3-2",rotation:"180"},{id:"house-2",model:"house-2",cell:"cell-2-3",rotation:"90"},{id:"fence-1",model:"fence",cell:"cell-7-11",rotation:"0"},{id:"fence-2",model:"fence",cell:"cell-8-11",rotation:"0"},{id:"fence-3",model:"fence",cell:"cell-9-11",rotation:"0"},{id:"oak-1",model:"oak-tree",cell:"cell-12-4",rotation:"0"},{id:"oak-2",model:"oak-tree",cell:"cell-12-12",rotation:"90"},{id:"oak-3",model:"oak-tree",cell:"cell-5-8",rotation:"180"}]}),Up=Object.freeze({[Rx.name]:Rx,[_x.name]:_x,[Tx.name]:Tx}),i4=Object.freeze(Object.keys(Up)),a4=Object.freeze([Object.freeze(["fox","canine"]),Object.freeze(["canine","animal"]),Object.freeze(["goblin","humanoid"]),Object.freeze(["humanoid","creature"]),Object.freeze(["creature","animal"]),Object.freeze(["crumb","food"]),Object.freeze(["morsel","food"]),Object.freeze(["food","thing"]),Object.freeze(["prop","thing"])])});var Bp=M(()=>{});var Cx=M(()=>{});var oa,O4,v0,x0,E0,S0,j0,k0,R0,_0,T0,A0,C0,I0,O0,N0,L0,P0,M0,N4,Wp=M(()=>{Sl();Bp();ys();qe();Go();Cx();it();lo();na();Vr();oa=Object.freeze({predator:{role:"predator",kind:"fox",idPrefix:"fox",hunts:"prey"},prey:{role:"prey",kind:"goblin",idPrefix:"goblin",hunts:null},food:{spawnedKind:"crumb",placedKind:"morsel"}}),O4=Object.freeze(["predator","prey"]),v0="mgx:currently-in",x0="mgx:hasMass",E0="mgx:feels",S0="mgx:facing",j0="mgx:driven-facing",k0="mgx:eaten-by",R0="mgx:starved",_0="mgx:placed-by",T0="mgx:model",A0="mgx:rotation",C0="mgx:carrying",I0="mgx:prey-eaten",O0="mgx:web-built-at-turn",N0="mgx:laid-at-turn",L0="mgx:hatched-into",P0="mgx:turn-played",M0=new Set([v0,x0,E0,S0,j0,k0,R0,_0,T0,A0,P0,C0,I0,O0,N0,L0,"rdf:type",Dp]),N4=Object.freeze([...M0].sort())});var Q4,Z4,Ox=M(()=>{jx();Sl();Wp();Go();yl();qe();lo();Q4=new RegExp("^@(spider|fly)(?:-(\\d+))?[,:]?\\s+the\\s+(spider|fly)(?:-(\\d+))?\\s+is\\s+(?:(north|south|east|west)|at\\s+(cell-\\d+-\\d+))[.!?\\s]*$","i"),Z4=Object.freeze({"catch-prey":"caught","eat-agent":"eaten",starve:"starved","lay-egg":"laid","hatch-egg":"hatched","spawn-prey":"spawned"})});var TX,AX,CX,IX,OX,NX,LX,U0,B0,W0,G0,Nx,Lx,V0,PX,MX,Px=M(()=>{Sl();Wp();Vr();Sn();Go();yl();qe();lo();na();Bp();bl();ys();TX=oa.predator.kind,AX=oa.prey.kind,CX=oa.food.spawnedKind,IX=oa.food.placedKind,OX=Object.freeze(new Set(["river-crossing"])),NX=new RegExp("^@(fox|goblin)(?:-(\\d+))?[,:]?\\s+the\\s+(fox|goblin|crumb|morsel)(?:-(\\d+))?\\s+is\\s+(?:(north|south|east|west)|at\\s+(cell-\\d+-\\d+))[.!?\\s]*$","i"),LX=new RegExp("^who\\s+(?:put|placed|dropped)\\s+(?:(?:the\\s+)?(morsel|crumb)(?:-(\\d+))?|(?:(?:the\\s+)?(?:food|morsel|crumb|that|it)\\s+)?(?:at|on)\\s+(cell-\\d+-\\d+))(?:\\s+there)?[?.!\\s]*$","i"),U0="mgx:currently-in",B0="mgx:hasMass",W0="mgx:feels",G0="mgx:facing",Nx="(fox|goblin|crumb|morsel)(?:-(\\d+))?",Lx="(fox|goblin)(?:-(\\d+))?",V0="(crumb|morsel)(?:-(\\d+))?",PX=[{kind:"placement",predicate:U0,re:new RegExp(`^(?:the\\s+)?${Nx}\\s+is\\s+at\\s+(cell-\\d+-\\d+)[.!\\s]*$`,"i")},{kind:"mass",predicate:B0,re:new RegExp(`^(?:the\\s+)?${Nx}\\s+weighs\\s+(\\d+(?:\\.\\d+)?)[.!\\s]*$`,"i")},{kind:"mood",predicate:W0,re:new RegExp(`^(?:the\\s+)?${Lx}\\s+feels\\s+(calm|angry|scared|happy)[.!\\s]*$`,"i")},{kind:"facing",predicate:G0,re:new RegExp(`^(?:the\\s+)?${Lx}\\s+faces\\s+(north|south|east|west)[.!\\s]*$`,"i")}],MX=new RegExp(`^(?:the\\s+)?([a-z][a-z-]*)\\s+(?:put|placed|dropped)\\s+(?:the\\s+)?${V0}\\s+there[.!\\s]*$`,"i")});var Mx=M(()=>{na()});var Rt,GX,VX,HX,qX,KX,YX,XX,JX,QX,ZX,e8,t8,n8,s8,o8,r8,i8,a8,H0,Fx=M(()=>{Rt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},GX=Rt("createRequire"),VX=Rt("readFileSync"),HX=Rt("access"),qX=Rt("readFile"),KX=Rt("writeFile"),YX=Rt("appendFile"),XX=Rt("mkdir"),JX=Rt("mkdtemp"),QX=Rt("rename"),ZX=Rt("unlink"),e8=Rt("rm"),t8=Rt("stat"),n8=Rt("copyFile"),s8=Rt("readdir"),o8=Rt("createReadStream"),r8=Rt("createWriteStream"),i8=Rt("randomBytes"),a8=Rt("spawnSync"),H0=Rt("createInterface")});var _t,l8,u8,d8,f8,p8,m8,h8,g8,b8,w8,y8,$8,v8,x8,E8,S8,j8,Dx,k8,Gp=M(()=>{_t=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},l8=_t("createRequire"),u8=_t("readFileSync"),d8=_t("access"),f8=_t("readFile"),p8=_t("writeFile"),m8=_t("appendFile"),h8=_t("mkdir"),g8=_t("mkdtemp"),b8=_t("rename"),w8=_t("unlink"),y8=_t("rm"),$8=_t("stat"),v8=_t("copyFile"),x8=_t("readdir"),E8=_t("createReadStream"),S8=_t("createWriteStream"),j8=_t("randomBytes"),Dx=_t("spawnSync"),k8=_t("createInterface")});var zx=M(()=>{Gp();Je();Lt();Je();Oi();Kt()});var Ux=M(()=>{});var q0,Bx=M(()=>{Lt();Je();qe();Ux();q0=ne(".tmct","sessions")});var Wx=M(()=>{Lt();Je();Kc()});var Gx,jl,Vx=M(()=>{Gx=Object.freeze({countNouns:{class:"Class",classes:"Class",function:"Function",functions:"Function",func:"Function",funcs:"Function",module:"Module",modules:"Module",file:"Module",files:"Module",package:"Package",packages:"Package",method:"Method",methods:"Method",attribute:"Attribute",attributes:"Attribute",variable:"GlobalVariable",variables:"GlobalVariable",global:"GlobalVariable",globals:"GlobalVariable",commit:"Commit",commits:"Commit",session:"Session",sessions:"Session"},classLabels:{Class:["class","classes"],Function:["function","functions"],Module:["module","modules"],Package:["package","packages"],Method:["method","methods"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"],Session:["session","sessions"]},helpRows:[["/find <query>","lexical search across the graph"],["/search <query>","alias of /find"],["/context <symbol>","the sized edit bundle for a symbol (start here to change code)"],["/snippet <symbol>","exact source of one function/class/method"],["/describe <symbol>","a symbol's definition, kind and relations"],["/signature <symbol>","a symbol's signature only"],["/members <class>","the methods/attributes of a class"],["/subclasses <class>","the subclasses of a class"],["/impact <module>","what a change to this module or symbol reaches (impact closure)"],["/callers <symbol>","functions that call this symbol"],["/callees <symbol>","functions this symbol calls"],["/tests <symbol>","the tests covering this symbol"],["/untested","symbols with no covering test"],["/history <symbol>","the commit history of this symbol"],["/exports <module>","a module's public exports"],["/arch [package]","the architecture overview (optional package filter)"]],missRecoveryPointer:"for code structure, index this repo with `tmct index`, or point me at a .tmct/graph.json with --repo <path> (or try `npm run example:mini`)."}),jl=Object.freeze({countNouns:{},classLabels:{},helpRows:[],missRecoveryPointer:""})});var Tt,q8,K8,Y8,X8,J8,Q8,Z8,e6,t6,n6,s6,o6,r6,i6,a6,c6,l6,u6,Hx,qx=M(()=>{Tt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},q8=Tt("createRequire"),K8=Tt("readFileSync"),Y8=Tt("access"),X8=Tt("readFile"),J8=Tt("writeFile"),Q8=Tt("appendFile"),Z8=Tt("mkdir"),e6=Tt("mkdtemp"),t6=Tt("rename"),n6=Tt("unlink"),s6=Tt("rm"),o6=Tt("stat"),r6=Tt("copyFile"),i6=Tt("readdir"),a6=Tt("createReadStream"),c6=Tt("createWriteStream"),l6=Tt("randomBytes"),u6=Tt("spawnSync"),Hx=Tt("createInterface")});var Qx={};Nt(Qx,{CONTEXT_PASSAGE_PREDICATE:()=>Yx,CO_OCCURS_PREDICATE:()=>kl,ingestUnknownFromAssertions:()=>X0,knownTermsFrom:()=>Xx,passageFor:()=>Jx});function Xx(e,t){let n=new Set;for(let s of e?.individuals||[]){if(s?.class!==Et)continue;let o=a=>(s.attributes||[]).find(c=>c?.key===a)?.value,r=o("subject"),i=o("object");r&&n.add(q(r)),i&&n.add(q(i))}for(let s of t||[])s?.subject&&n.add(q(s.subject)),s?.object&&n.add(q(s.object));return n}function Jx(e,t){let n=e?.surfaceText;if(typeof n=="string"&&n.trim())return n.replace(/\[\[([^\]]+)\]\]/g,"$1").replace(/\s+/g," ").trim();let s=uo(e?.start),o=uo(e?.end);return t?.surface&&s&&o?t.surface.replace("{start}",s).replace("{end}",o):null}function Y0(e,t,n){let s=String(e||"").toLowerCase().replace(/[^a-z0-9\s]/g," ").split(/\s+/).filter(Boolean),o=[],r=new Set;for(let i=0;i<s.length&&o.length<Kx;i+=1){let a=[s[i]];i+1<s.length&&a.push(`${s[i]} ${s[i+1]}`);for(let c of a)if(!(K0.has(c)||r.has(c)||n.has(c))&&t.has(c)&&(o.push(c),r.add(c),o.length>=Kx))break}return o}async function X0(e,{assertions:t,map:n,mappedFacts:s=[],memory:o,provenancePrefix:r="corpus:unknown",limit:i=500}={}){if(!Array.isArray(t)||!n)return{captured:0,linked:0,appended:0,skipped:0};let a=o||await pt(e),c=Xx(a,s),l=new Set,u=[];for(let f of t){if(l.size>=i)break;let m=n.get(f.rel);if(!m||m.ace!=="none")continue;let h=uo(f.start),g=uo(f.end);if(!h||!g)continue;let b=q(h),y=q(g),$=!c.has(b),E=!c.has(y);if(!$&&!E)continue;let _=Jx(f,m);if(!_)continue;let v=[[h,g,$],[g,h,E]];for(let[S,C,x]of v){if(!x||l.size>=i)continue;let R=q(S);if(l.has(R))continue;let w=`${r} ${f.rel}`;u.push({subject:S,predicate:Yx,object:_,provenance:w}),u.push({subject:S,predicate:kl,object:C,provenance:w});let T=Y0(_,c,new Set([b,y]));for(let I of T)u.push({subject:S,predicate:kl,object:I,provenance:w});l.add(R),c.add(R)}}if(!u.length)return{captured:0,linked:0,appended:0,skipped:0};let d=await as(e,u),p=u.filter(f=>f.predicate===kl).length;return{captured:l.size,linked:p,appended:d.appended,skipped:d.skipped}}var Yx,kl,K0,Kx,Zx=M(()=>{qe();Rl();Yx="mgx:contextPassage",kl="mgx:coOccursWith",K0=new Set(["a","an","the","is","are","was","were","be","being","been","to","of","for","in","on","at","with","by","as","and","or","that","this","it","its","you","your","related","kind","used"]),Kx=3});var eE={};Nt(eE,{MAP_FILE:()=>ia,SEON_CONCEPTS_FILE:()=>_l,SEON_DEFINITIONS_FILE:()=>J0,SLICE_FILE:()=>ra,TIER2_DIR:()=>ls,TIER2_MANIFEST_FILE:()=>Q0,WORDNET_DIR:()=>aa,loadMap:()=>Al,loadSlice:()=>Tl,seedMemory:()=>e1,termText:()=>uo,toFacts:()=>Cl});async function Tl(e=ra){let t=Hx({input:dv(e,"utf8"),crlfDelay:1/0}),n=[],s=0;for await(let o of t){s+=1;let r=o.trim();if(!r)continue;let i;try{i=JSON.parse(r)}catch(a){throw new Error(`${e}:${s}: not valid JSON: ${a.message}`)}for(let a of["start","rel","end"])if(typeof i[a]!="string"||!i[a])throw new Error(`${e}:${s}: assertion missing "${a}"`);n.push(i)}return n}async function Al(e=ia){let n=Mo(await Ce(e,"utf8")).relation||[],s=new Map;for(let o of n){if(!o.rel)throw new Error(`${e}: a [[relation]] row is missing "rel"`);if(s.has(o.rel))throw new Error(`${e}: duplicate mapping for ${o.rel}`);if(!Z0.has(o.ace))throw new Error(`${e}: ${o.rel} has unknown ace pattern ${JSON.stringify(o.ace)}`);if(o.ace!=="none"&&!o.predicate)throw new Error(`${e}: ${o.rel} maps to ${o.ace} but names no predicate URI`);s.set(o.rel,o)}return s}function Cl(e,t,n="corpus:conceptnet"){let s=[];for(let o of e){let r=t.get(o.rel);if(!r)throw new Error(`slice/map drift: relation ${o.rel} has no row in conceptnet-map.toml`);if(r.ace==="none")continue;let i=uo(o.start),a=uo(o.end);if(!i||!a)continue;let c=r.predicate==="mgx:relatedTo"?n.replace(/^corpus:/,"corpus-weak:"):n;s.push({subject:i,predicate:r.predicate,object:a,provenance:`${c} ${o.rel}`})}return s}async function e1(e,{limit:t,slicePath:n=ra,mapPath:s=ia,prefer:o,provenancePrefix:r,captureUnknownContext:i=!1,unknownContextLimit:a}={}){let[c,l]=await Promise.all([Tl(n),Al(s)]),u=Cl(c,l,r);if(Array.isArray(o)&&o.length){let y=new Map(o.map(($,E)=>[$,E]));u=u.slice().sort(($,E)=>(y.get($.predicate)??o.length)-(y.get(E.predicate)??o.length))}t!==void 0&&(u=u.slice(0,t));let d=(y,$,E)=>`${q(y)} ${$} ${q(E)}`,p=new Set,f=await pt(e);for(let y of f.individuals||[]){if(y?.class!=="Fact")continue;let $=E=>(y.attributes||[]).find(_=>_.key===E)?.value;p.add(d($("subject"),$("predicate"),$("object")))}let m=0,h=[];for(let y of u){let $=d(y.subject,y.predicate,y.object);if(p.has($)){m+=1;continue}p.add($),h.push(y)}let g=await as(e,h),b;if(i){let{ingestUnknownFromAssertions:y}=await Promise.resolve().then(()=>(Zx(),Qx));b=await y(e,{assertions:c,map:l,mappedFacts:u,memory:f,provenancePrefix:r?`${r}-unknown`:void 0,limit:a})}return{appended:g.appended,skipped:m+g.skipped,total:u.length,...b?{unknown:b}:{}}}var t1,qr,ra,ia,_l,J0,ls,Q0,aa,v6,Z0,uo,Rl=M(()=>{Bo();Lt();qx();ao();Je();Rc();qe();t1={},qr=ne(ye(qt(t1.url)),"..","..",".."),ra=ne(qr,"corpus","conceptnet","slice.jsonl"),ia=ne(qr,"src","adapters","corpus","conceptnet-map.toml"),_l=ne(qr,"corpus","domains","code","concepts.jsonl"),J0=ne(qr,"corpus","domains","code","definitions.jsonl"),ls=ne(qr,"corpus","tier2"),Q0=ne(ls,"manifest.json"),aa=ne(qr,"corpus","wordnet"),v6=ne(aa,"manifest.json"),Z0=new Set(["subClassOf","type","ObjectProperty","someValuesFrom","disjointWith","property","none"]);uo=e=>{let t=/^\/c\/en\/([^/]+)/.exec(String(e||""));return t?t[1].replace(/_/g," "):null}});var iE={};Nt(iE,{BUILTIN_EXTENSIONS:()=>r1,EXTENSION_KINDS:()=>Il,activeDomainPacks:()=>Yp,defaultCodeDomainPacks:()=>rE,defaultCodeLaneVocab:()=>oE,mergedLaneVocab:()=>Kp,mergedLexiconExtra:()=>sE,resolveExtensions:()=>nE,seedActiveCorpusEntries:()=>c1,validateExtensionEntry:()=>tE,validateExtensionPack:()=>u1});function Ol(){return{seon:{kind:"corpus",active:!1,corpusPath:_l,provenancePrefix:"corpus:seon"},code:{kind:"pack",active:!1,corpusPath:_l,provenancePrefix:"corpus:seon",vocabPath:s1,vocabData:Gx,groundingKind:"extraction",groundingAdapter:"tmct index (the graphPaths provider seam)"},conceptnet:{kind:"corpus",active:!1,corpusPath:ra,provenancePrefix:"corpus:conceptnet",limit:void 0,prefer:o1},human:{kind:"corpus",active:!0,corpusPath:ne(ls,"human.jsonl"),provenancePrefix:"corpus:human"},"human-medium":{kind:"corpus",active:!1,corpusPath:ne(ls,"human-medium.jsonl"),provenancePrefix:"corpus:human-medium"},"human-large":{kind:"corpus",active:!1,corpusPath:ne(ls,"human-large.jsonl"),provenancePrefix:"corpus:human-large"},"tier2-aws":{kind:"pack",active:!1,corpusPath:ne(ls,"aws.jsonl"),provenancePrefix:"corpus:tier2-aws",vocabPath:Vp,vocabData:jl,groundingKind:"taught-only"},"tier2-python":{kind:"pack",active:!1,corpusPath:ne(ls,"python.jsonl"),provenancePrefix:"corpus:tier2-python",vocabPath:Vp,vocabData:jl,groundingKind:"taught-only"},"tier2-java":{kind:"pack",active:!1,corpusPath:ne(ls,"java.jsonl"),provenancePrefix:"corpus:tier2-java",vocabPath:Vp,vocabData:jl,groundingKind:"taught-only"},"tier2-general":{kind:"corpus",active:!1,corpusPath:ne(ls,"general.jsonl"),provenancePrefix:"corpus:tier2-general"},"wordnet-xl":{kind:"corpus",active:!1,corpusPath:ne(aa,"wordnet-xl.jsonl"),provenancePrefix:"corpus:wordnet-xl"},"wordnet-full":{kind:"corpus",active:!1,corpusPath:ne(aa,"wordnet-full.jsonl"),provenancePrefix:"corpus:wordnet-full"},namenet:{kind:"corpus",active:!1,corpusPath:ne(n1,"namenet.jsonl"),provenancePrefix:"corpus:namenet"}}}function tE(e,t){if(!t||typeof t!="object")throw new Error(`extension "${e}": entry must be an object`);if(!Il.includes(t.kind))throw new Error(`extension "${e}": unknown kind ${JSON.stringify(t.kind)} (must be one of ${Il.join(", ")})`);if(t.active!==void 0&&typeof t.active!="boolean")throw new Error(`extension "${e}": "active" must be a boolean`);if(t.kind==="corpus"&&!t.corpusPath)throw new Error(`extension "${e}": a "corpus" entry needs corpus_path`);if(t.kind==="ontology"&&!t.corpusPath)throw new Error(`extension "${e}": an "ontology" entry needs ontology_path`);if(t.kind==="lexicon"&&!t.lexiconPath)throw new Error(`extension "${e}": a "lexicon" entry needs lexicon_path`);if(t.kind==="templates"&&!t.templatesPath)throw new Error(`extension "${e}": a "templates" entry needs templates_path`);if(t.kind==="pack"&&!t.corpusPath&&!t.lexiconPath&&!t.templatesPath&&!t.phrasebookPath)throw new Error(`extension "${e}": a "pack" entry needs at least one of corpus_path/lexicon_path/templates_path/phrasebook_path`);if(t.limit!==void 0&&!Number.isFinite(t.limit))throw new Error(`extension "${e}": "limit" must be a finite number`);if(t.prefer!==void 0&&!Array.isArray(t.prefer))throw new Error(`extension "${e}": "prefer" must be an array of predicate URIs`)}function a1(e,t,n,s){if(!t&&n.kind===void 0)throw new Error(`extension "${e}": an unrecognized extension needs a "kind" (one of ${Il.join(", ")})`);let o={kind:n.kind!==void 0?n.kind:t?.kind,active:n.active!==void 0?!!n.active:!!t?.active},r=[["corpus_path","corpusPath"],["ontology_path","corpusPath"],["lexicon_path","lexiconPath"],["templates_path","templatesPath"],["phrasebook_path","phrasebookPath"],["map_path","mapPath"],["vocab_path","vocabPath"]];for(let[i,a]of r)n[i]!==void 0?o[a]=i1(s,n[i]):t?.[a]!==void 0&&(o[a]=t[a]);return o.provenancePrefix=n.provenance_prefix!==void 0?String(n.provenance_prefix):t?.provenancePrefix??`corpus:${e}`,n.limit!==void 0?o.limit=Number(n.limit):t?.limit!==void 0&&(o.limit=t.limit),n.prefer!==void 0?o.prefer=n.prefer:t?.prefer!==void 0&&(o.prefer=t.prefer),n.grounding_kind!==void 0?o.groundingKind=String(n.grounding_kind):t?.groundingKind!==void 0&&(o.groundingKind=t.groundingKind),n.grounding_adapter!==void 0?o.groundingAdapter=String(n.grounding_adapter):t?.groundingAdapter!==void 0&&(o.groundingAdapter=t.groundingAdapter),o}async function nE(e,{configFile:t}={}){let n=e?await Ac(e,t?{file:t}:{}):null,s=Ol(),o=n&&n.extensions&&typeof n.extensions=="object"?n.extensions:{},r=n&&n.bias&&typeof n.bias=="object"?n.bias:{},i=new Set([...Object.keys(s),...Object.keys(o)]),a=new Map;for(let p of i){let f=a1(p,s[p]||null,o[p]||{},e||process.cwd());tE(p,f),a.set(p,f)}let c={};for(let[p,f]of Object.entries(r)){if(typeof f!="number"||!Number.isFinite(f))throw new Error(`[bias] "${p}": bias must be a finite number, got ${JSON.stringify(f)}`);c[p]=f}let u=["seon","conceptnet",...[...a.keys()].filter(p=>p!=="seon"&&p!=="conceptnet").sort()].filter(p=>a.has(p));return{entries:new Map(u.map(p=>[p,a.get(p)])),biasByBundle:c}}async function c1(e,t,n={}){let{seedMemory:s}=await Promise.resolve().then(()=>(Rl(),eE)),{captureUnknownContext:o,unknownContextLimit:r}=n,i={},a=0,c=0,l=0;for(let[u,d]of t instanceof Map?t:new Map)if(!(!d.active||!(d.kind==="corpus"||d.kind==="ontology"||d.kind==="pack"&&d.corpusPath)))try{let f=await s(e,{slicePath:d.corpusPath,mapPath:d.mapPath,provenancePrefix:d.provenancePrefix,limit:d.limit,prefer:d.prefer,captureUnknownContext:o,unknownContextLimit:r});i[u]={appended:f.appended,skipped:f.skipped,total:f.total},a+=f.appended,c+=f.skipped,l+=f.total}catch(f){i[u]={appended:0,skipped:0,total:0,error:f&&f.message?f.message:String(f)}}return{appended:a,skipped:c,total:l,perBundle:i}}async function sE(e,t={}){let n=[];for(let[o,r]of e instanceof Map?e:new Map)r.active&&(r.kind!=="lexicon"&&r.kind!=="pack"||r.lexiconPath&&n.push({name:o,path:r.lexiconPath,bias:t[o]??1}));if(!n.length)return null;n.sort((o,r)=>o.bias-r.bias);let s={nouns:{},verbs:{},adjectives:{},properNames:[]};for(let o of n){let r;try{r=JSON.parse(await Ce(o.path,"utf8"))}catch(i){throw new Error(`extension "${o.name}": lexicon file ${o.path} \u2014 ${i&&i.message?i.message:i}`)}if(Object.assign(s.nouns,r.nouns||{}),Object.assign(s.verbs,r.verbs||{}),Object.assign(s.adjectives,r.adjectives||{}),Array.isArray(r.properNames))for(let i of r.properNames)s.properNames.includes(i)||s.properNames.push(i)}return s}async function Kp(e,t={}){let n=[];for(let[o,r]of e instanceof Map?e:new Map)r.active&&r.kind==="pack"&&(!r.vocabPath&&!r.vocabData||n.push({name:o,path:r.vocabPath,data:r.vocabData,bias:t[o]??1}));let s={countNouns:{},classLabels:{},helpRows:[],missRecoveryPointer:""};if(!n.length)return s;n.sort((o,r)=>o.bias-r.bias);for(let o of n){let r;if(o.data)r=o.data;else try{r=JSON.parse(await Ce(o.path,"utf8"))}catch(i){throw new Error(`extension "${o.name}": vocab file ${o.path} \u2014 ${i&&i.message?i.message:i}`)}Object.assign(s.countNouns,r.countNouns||{}),Object.assign(s.classLabels,r.classLabels||{}),Array.isArray(r.helpRows)&&s.helpRows.push(...r.helpRows),r.missRecoveryPointer&&(s.missRecoveryPointer=r.missRecoveryPointer)}return s}function oE(){if(!Hp){let e={...Ol().code,active:!0};Hp=Kp(new Map([["code",e]]),{})}return Hp}async function l1(e,t){let n={name:e,groundingKind:t.groundingKind||"",groundingAdapter:t.groundingAdapter||"",commandCount:0,countNounCount:0};if(!t.vocabPath)return n;try{let s=JSON.parse(await Ce(t.vocabPath,"utf8"));n.commandCount=Array.isArray(s.helpRows)?s.helpRows.length:0,n.countNounCount=Object.keys(s.countNouns||{}).length}catch{}return n}async function Yp(e,t={}){let n=[];for(let[o,r]of e instanceof Map?e:new Map)r.active&&r.kind==="pack"&&n.push({name:o,entry:r,bias:t[o]??1});n.sort((o,r)=>o.bias-r.bias||o.name.localeCompare(r.name));let s=[];for(let o of n)s.push(await l1(o.name,o.entry));return s}function rE(){if(!qp){let e={...Ol().code,active:!0};qp=Yp(new Map([["code",e]]),{})}return qp}async function u1(e,t){let n=[],s=o=>o&&(su(o)?o:Gt(e,o));if(t.corpusPath){let o=s(t.corpusPath);try{let r=await Tl(o),i=await Al(s(t.mapPath)||ia),a=Cl(r,i,t.provenancePrefix||"corpus:pack");n.push({kind:"corpus",path:o,ok:!0,counts:{assertions:r.length,facts:a.length}})}catch(r){n.push({kind:"corpus",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.lexiconPath){let o=s(t.lexiconPath);try{let{loadLexicon:r}=await Promise.resolve().then(()=>(cs(),$v)),i=JSON.parse(await Ce(o,"utf8")),a=r(i);n.push({kind:"lexicon",path:o,ok:!0,counts:{nouns:a.nouns.size,verbs:a.verbs.size,adjectives:a.adjectives.size,properNames:a.properNames.size}})}catch(r){n.push({kind:"lexicon",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.templatesPath){let o=s(t.templatesPath);try{let{loadTemplates:r}=await Promise.resolve().then(()=>(Yc(),lv)),i=await r(o),a=[...i.keys()].filter(c=>!c.includes(":"));if(a.length)throw new Error(`template id${a.length>1?"s":""} not namespaced "<packname>:<id>": ${a.join(", ")}`);n.push({kind:"templates",path:o,ok:!0,counts:{templates:i.size}})}catch(r){n.push({kind:"templates",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.vocabPath){let o=s(t.vocabPath);try{let r=JSON.parse(await Ce(o,"utf8")),i=r.countNouns&&typeof r.countNouns=="object"?Object.keys(r.countNouns).length:0,a=r.classLabels&&typeof r.classLabels=="object"?Object.keys(r.classLabels).length:0,c=Array.isArray(r.helpRows)?r.helpRows.length:0;n.push({kind:"vocab",path:o,ok:!0,counts:{countNouns:i,classLabels:a,helpRows:c}})}catch(r){n.push({kind:"vocab",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.kind==="pack"){let o=t.groundingKind;o!=="extraction"&&o!=="taught-only"?n.push({kind:"grounding",path:"(pack manifest)",ok:!1,error:`a "pack" entry needs "grounding_kind" of "extraction" or "taught-only" (got ${JSON.stringify(o??null)})`}):o==="extraction"&&!t.groundingAdapter?n.push({kind:"grounding",path:"(pack manifest)",ok:!1,error:'grounding_kind "extraction" needs "grounding_adapter" naming the adapter'}):n.push({kind:"grounding",path:"(pack manifest)",ok:!0,counts:o==="extraction"?{channel:o,adapter:t.groundingAdapter}:{channel:o}})}return{ok:n.length>0&&n.every(o=>o.ok),results:n}}var Xp,n1,s1,Vp,Il,o1,r1,i1,Hp,qp,Jp=M(()=>{Je();Lt();ao();Vx();Oi();Rl();Xp={},n1=ne(ye(qt(Xp.url)),"..","..","corpus","namenet"),s1=ne(ye(qt(Xp.url)),"..","..","corpus","domains","code","vocab.json"),Vp=ne(ye(qt(Xp.url)),"..","..","corpus","tier2","vocab-empty.json"),Il=Object.freeze(["corpus","lexicon","templates","pack","ontology"]),o1=["rdfs:subClassOf","rdf:type","mgx:usedFor","mgx:partOf","mgx:capableOf","mgx:atLocation","mgx:causes","mgx:desires","mgx:motivatedByGoal","mgx:hasSubevent"];r1=Object.freeze(Ol());i1=(e,t)=>{if(t==null)return;let n=String(t);return su(n)?n:Gt(e,n)};Hp=null;qp=null});var aE=M(()=>{});var cE=M(()=>{Je();Bo();Lt();wp();Fx();Gp();Kt();zx();De();Bx();Kc();Wx();ni();Jp();ea();lo();qc();wl();gp();$p();Br();aE()});var lE={};Nt(lE,{proseLemma:()=>p1});function p1(){if(qo!==void 0)return qo;try{let e=Zc();if(!e)return qo=null,qo;let t=e.its,n=new Map;qo=s=>{let o=String(s||"");if(n.has(o))return n.get(o);let r;try{r=String(e.readDoc(o).tokens().out(t.lemma)[0]||o).toLowerCase()}catch{r=o.toLowerCase()}return n.set(o,r),r}}catch{qo=null}return qo}var qo,uE=M(()=>{el()});var dE={};Nt(dE,{digestTermFromRows:()=>g1,loadDigestStructureTable:()=>h1,readDigestStructures:()=>m1});var m1,h1,g1,fE=M(()=>{m1=()=>null,h1=()=>null,g1=()=>null});var rm={};Nt(rm,{DEFAULT_MODULE_HOPS:()=>tm,DEFAULT_PROVE_BRANCHES:()=>vE,DEFAULT_PROVE_NODES:()=>xE,DEFAULT_PROVE_STEPS:()=>$E,MAX_PROVEN_CASES:()=>SE,MAX_ROLE_ASSERTIONS:()=>EE,TABLEAU_RULE_CONFIDENCE:()=>x1,buildTableauKb:()=>V1,canonicalKey:()=>Ge,extractTableauModule:()=>K1,findTableauViolations:()=>q1,isSatisfiable:()=>sm,moduleHasDlShape:()=>X1,proveEntailment:()=>U1,proveSubsumption:()=>B1,proveSubsumptionOfNegation:()=>W1,toNNF:()=>Qt});function Ge(e){if(!e||typeof e!="object"||typeof e.t!="string")throw new TypeError("canonicalKey: expr must be a concept-expression object carrying a t tag");switch(e.t){case"top":return"top";case"bot":return"bot";case"atom":return`atom(${e.name})`;case"nom":return`nom(${e.ind})`;case"not":return`not(${Ge(e.c)})`;case"and":return`and(${e.cs.map(Ge).sort().join(",")})`;case"or":return`or(${e.cs.map(Ge).sort().join(",")})`;case"some":return`some(${e.r},${Ge(e.c)})`;case"all":return`all(${e.r},${Ge(e.c)})`;case"atLeast":return`atLeast(${e.n},${e.r},${Ge(e.c)})`;case"atMost":return`atMost(${e.n},${e.r},${Ge(e.c)})`;default:throw new TypeError(`canonicalKey: unknown expression tag "${e.t}"`)}}function ca(e,t){if(!e||typeof e!="object"||typeof e.t!="string")throw new TypeError("toNNF: expr must be a concept-expression object carrying a t tag");switch(e.t){case"top":return t?{t:"bot"}:{t:"top"};case"bot":return t?{t:"top"}:{t:"bot"};case"atom":return t?{t:"not",c:{t:"atom",name:e.name}}:{t:"atom",name:e.name};case"nom":return t?{t:"not",c:{t:"nom",ind:e.ind}}:{t:"nom",ind:e.ind};case"not":return ca(e.c,!t);case"and":case"or":{let n=e.t==="and"?"or":"and",s=e.cs.map(o=>ca(o,t));return s.sort((o,r)=>Ge(o).localeCompare(Ge(r))),{t:t?n:e.t,cs:s}}case"some":case"all":{let n=e.t==="some"?"all":"some",s=ca(e.c,t);return{t:t?n:e.t,r:e.r,c:s}}case"atLeast":case"atMost":{let n=ca(e.c,!1);return t?e.t==="atLeast"?{t:"atMost",n:e.n-1,r:e.r,c:n}:{t:"atLeast",n:e.n+1,r:e.r,c:n}:{t:e.t,n:e.n,r:e.r,c:n}}default:throw new TypeError(`toNNF: unknown expression tag "${e.t}"`)}}function Qt(e){return ca(e,!1)}function Wt(e){return[...new Set((Array.isArray(e)?e:[]).filter(Boolean))].sort()}function Zp(e,t){let n=Number(e);return Number.isFinite(n)&&n>0?Math.floor(n):t}function y1(e,t){let n=Number(e);return Number.isFinite(n)&&n>=0?Math.floor(n):t}function yE(e,t){let n=new Set(e),s=!0;for(;s;){s=!1;for(let o of t)n.has(o.subject)&&!n.has(o.object)&&(n.add(o.object),s=!0),n.has(o.object)&&!n.has(o.subject)&&(n.add(o.subject),s=!0)}return n}function $1(e){let t=new Map;for(let[s,o]of e||[])!s||!o||s===o||(t.has(s)||t.set(s,new Set),t.get(s).add(o));let n=new Map;return s=>{if(n.has(s))return n.get(s);let o=new Set,r=[...t.get(s)||[]];for(;r.length;){let i=r.pop();if(!o.has(i)){o.add(i);for(let a of t.get(i)||[])o.has(a)||r.push(a)}}return n.set(s,o),o}}function v1(e,t){let n=(e||[]).map(([r,i])=>[fs(r),fs(i)]),s=$1(n.map(([r,i])=>[i,r])),o=new Map;for(let r of t){let i=fs(r);o.set(i,new Set([i,...s(i)]))}return o}function pE(e,t,n){let s=fs(t),o=fs(n);if(s===o)return!0;let r=e&&e.roleClosure?e.roleClosure.get(o):null;return r?r.has(s):!1}function Pl(e,t,n,s){let o=[];for(let r of e.edges)if(r.from===n&&pE(t,r.r,s))o.push({to:r.to,fromFacts:r.fromFacts});else if(r.to===n){let i=t&&t.inverseOf?t.inverseOf.get(fs(r.r)):null;i&&pE(t,i,s)&&o.push({to:r.from,fromFacts:r.fromFacts})}return o}function Nl(e,t){return t==="fresh-0"?!1:e&&e.namedIndividuals&&e.namedIndividuals.has(t)?!0:!E1.test(t)}function la(e,t){return e<t?`${e}\u241F${t}`:`${t}\u241F${e}`}function S1(e,t,n,s){if(t===n)return;let o=la(t,n),r=e.inequalityFrom.get(o);e.inequalityFrom.set(o,Wt(r?[...r,...s]:s))}function jE(e,t,n,s){return n===s?!1:Nl(t,n)&&Nl(t,s)?!0:e.inequalityFrom.has(la(n,s))}function kE(e,t,n){let s=e.inequalityFrom.get(la(t,n));return s?s.slice():[]}function j1(e,t,n){let s=Nl(e,t),o=Nl(e,n);return s&&!o?[t,n]:o&&!s?[n,t]:t<n?[t,n]:[n,t]}function RE(e,t,n,s){if(n===s)return n;let[o,r]=j1(t,n,s),i=e.nodes.get(o),a=e.nodes.get(r);if(!i||!a)return o;for(let[d,{expr:p,from:f}]of a.labels){let m=i.labels.get(d);i.labels.set(d,{expr:p,from:m?Wt([...m.from,...f]):f.slice()})}let c=[],l=new Map;for(let d of e.edges){let p=d.from===r?o:d.from,f=d.to===r?o:d.to,m=`${p}\u241F${d.r}\u241F${f}`,h=l.get(m);if(h)h.fromFacts=Wt([...h.fromFacts,...d.fromFacts]);else{let g={from:p,r:d.r,to:f,fromFacts:d.fromFacts.slice()};l.set(m,g),c.push(g)}}e.edges=c;for(let d of e.nodes.values())d.parent===r&&(d.parent=o);let u=new Map;for(let[d,p]of e.inequalityFrom){let[f,m]=d.split("\u241F"),h=f===r?o:f,g=m===r?o:m;if(h===g)continue;let b=la(h,g),y=u.get(b);u.set(b,y?Wt([...y,...p]):p)}return e.inequalityFrom=u,e.nodes.delete(r),o}function nm(e,t){return{id:e,labels:new Map,parent:t??null,branchedOn:new Set,appliedAxioms:new Set,successorCount:0}}function Wn(e,t,n){let s=Ge(t);return e.labels.has(s)?!1:(e.labels.set(s,{expr:t,from:Wt(n)}),!0)}function Kr(e){return[...e.labels.entries()].sort((t,n)=>t[0].localeCompare(n[0]))}function Ll(e){if(e.labels.has("bot"))return{nodeId:e.id,keyA:"bot",keyB:"bot",premises:e.labels.get("bot").from.slice()};let t=[...e.labels.keys()].sort();for(let n of t){let{expr:s,from:o}=e.labels.get(n),r=Ge(Qt(ds(s)));if(r<=n)continue;let i=e.labels.get(r);if(i)return{nodeId:e.id,keyA:n,keyB:r,premises:Wt([...o,...i.from])}}return null}function mE(e,t){let n=new Set;for(let s of e.edges)s.to===t&&n.add(s.r);return n}function _E(e,t,n){let s=[...e.labels.keys()],o=!!(n&&n.inverseOf&&n.inverseOf.size>0),r=o?mE(t,e.id):null,i=e.parent;for(;i;){let a=t.nodes.get(i);if(!a)break;if(s.length===a.labels.size&&s.every(c=>a.labels.has(c))){if(!o)return!0;let c=mE(t,a.id);if(r.size===c.size&&[...r].every(l=>c.has(l)))return!0}i=a.parent}return!1}function hE(e){let t=new Map;for(let[n,s]of e.nodes)t.set(n,{id:s.id,labels:new Map(s.labels),parent:s.parent,branchedOn:new Set(s.branchedOn),appliedAxioms:new Set(s.appliedAxioms),successorCount:s.successorCount});return{nodes:t,edges:e.edges.slice(),closed:!1,clash:null,inequalityFrom:new Map(e.inequalityFrom),choices:(e.choices||[]).slice()}}function k1(e){for(let t of e.nodes.values())for(let[,{expr:n,from:s}]of Kr(t)){if(n.t!=="and")continue;let o=!1;for(let r of n.cs)Wn(t,r,s)&&(o=!0);if(o)return{applied:!0,touched:[t.id]}}return{applied:!1,touched:[]}}function R1(e,t){let n=new Map;for(let o of e.nodes.values())for(let r of o.labels.keys())r.startsWith("nom(")&&(n.has(r)||n.set(r,[]),n.get(r).push(o.id));let s=[...n.keys()].sort();for(let o of s){let r=[...new Set(n.get(o))].sort();if(r.length<2)continue;let[i,a]=r;if(jE(e,t,i,a)){let c=e.nodes.get(i).labels.get(o)?.from||[],l=e.nodes.get(a).labels.get(o)?.from||[];return{kind:"clash",clash:{nodeId:i,keyA:o,keyB:`merge(${i},${a})`,premises:Wt([...c,...l,...kE(e,i,a)])}}}return{kind:"merge",a:i,b:a}}return{kind:"none"}}function _1(e,t){let n=t&&t.transitiveRoles instanceof Set?t.transitiveRoles:null;for(let s of e.nodes.values())for(let[,{expr:o,from:r}]of Kr(s)){if(o.t!=="all")continue;let i=[];for(let{to:a,fromFacts:c}of Pl(e,t,s.id,o.r)){let l=e.nodes.get(a);if(!l)continue;let u=[...r,...c];Wn(l,o.c,u)&&i.push(l.id),n&&n.has(o.r)&&Wn(l,o,u)&&i.push(l.id)}if(i.length)return{applied:!0,touched:i}}return{applied:!1,touched:[]}}function T1(e,t){for(let n of e.nodes.values())for(let s=0;s<t.axioms.length;s+=1){if(n.appliedAxioms.has(s))continue;let o=t.axioms[s];if(n.appliedAxioms.add(s),Wn(n,o.disjunction,o.from))return{applied:!0,touched:[n.id]}}return{applied:!1,touched:[]}}function A1(e,t){if(Ge(t)==="bot")return[];let n=Ge(Qt(ds(t))),s=e.labels.get(n);return s?s.from:null}function C1(e,t,n){return n.some(s=>e.unionOrOneOfIds&&e.unionOrOneOfIds.has(s))&&t.every(s=>s.t==="atom"||s.t==="nom")}function I1(e,t){for(let n of e.nodes.values())for(let[s,{expr:o,from:r}]of Kr(n)){if(o.t!=="or"||n.branchedOn.has(s))continue;let i=[...o.cs].sort((d,p)=>Ge(d).localeCompare(Ge(p)));if(i.some(d=>n.labels.has(Ge(d)))){n.branchedOn.add(s);continue}let a=i.map(d=>({c:d,clashFrom:A1(n,d)})),c=a.filter(d=>d.clashFrom===null).map(d=>d.c),l=a.filter(d=>d.clashFrom!==null).flatMap(d=>d.clashFrom),u=C1(t,i,r)?{cs:i,from:r}:null;return c.length===0?{kind:"clash",clash:{nodeId:n.id,keyA:Ge(i[0]),keyB:Ge(Qt(ds(i[0]))),premises:Wt([...r,...l])},choice:u}:c.length===1?(n.branchedOn.add(s),Wn(n,c[0],[...r,...l]),{kind:"applied",touched:[n.id],choice:u}):(n.branchedOn.add(s),{kind:"split",node:n,from:r,disjuncts:c,choice:u})}return{kind:"none"}}function O1(e,t){for(let n of e.nodes.values())if(!_E(n,e,t))for(let[,{expr:s,from:o}]of Kr(n)){if(s.t!=="some")continue;let r=Ge(s.c);if(Pl(e,t,n.id,s.r).some(c=>e.nodes.get(c.to)?.labels.has(r)))continue;n.successorCount+=1;let a=nm(`${n.id}.${n.successorCount}`,n.id);return Wn(a,s.c,o),e.nodes.set(a.id,a),e.edges.push({from:n.id,r:s.r,to:a.id,fromFacts:o.slice()}),{applied:!0,touched:[a.id]}}return{applied:!1,touched:[]}}function N1(e,t){for(let n of e.nodes.values())for(let[s,{expr:o,from:r}]of Kr(n)){if(o.t!=="atMost")continue;let i=Ge(o.c),a=[...new Set(Pl(e,t,n.id,o.r).map(u=>u.to))].filter(u=>e.nodes.get(u)?.labels.has(i)).sort();if(a.length<=o.n)continue;let c=[];for(let u=0;u<a.length;u+=1)for(let d=u+1;d<a.length;d+=1)c.push([a[u],a[d]]);if(c.length===0){let u=e.nodes.get(a[0])?.labels.get(i)?.from||[];return{kind:"clash",clash:{nodeId:n.id,keyA:s,keyB:`witness(${a[0]})`,premises:Wt([...r,...u])}}}let l=c.filter(([u,d])=>!jE(e,t,u,d));if(l.length===0){let[u,d]=c[0];return{kind:"clash",clash:{nodeId:n.id,keyA:s,keyB:`merge(${u},${d})`,premises:Wt([...r,...kE(e,u,d)])}}}return{kind:"split-merge",pairs:l}}return{kind:"none"}}function L1(e,t){for(let n of e.nodes.values())if(!_E(n,e,t))for(let[,{expr:s,from:o}]of Kr(n)){if(s.t!=="atLeast")continue;let r=Ge(s.c),i=[...new Set(Pl(e,t,n.id,s.r).map(c=>c.to))].filter(c=>e.nodes.get(c)?.labels.has(r)).sort();if(i.length>=s.n)continue;n.successorCount+=1;let a=nm(`${n.id}.${n.successorCount}`,n.id);Wn(a,s.c,o),e.nodes.set(a.id,a),e.edges.push({from:n.id,r:s.r,to:a.id,fromFacts:o.slice()});for(let c of i)S1(e,a.id,c,o);return{applied:!0,touched:[a.id]}}return{applied:!1,touched:[]}}function P1(e,t){for(let n of t){let s=e.nodes.get(n),o=s&&Ll(s);if(o)return o}return null}function Ko(e,t){let n=P1(e,t);return n?{kind:"clash",clash:n}:{kind:"applied"}}function M1(e,t){let n=k1(e);if(n.applied)return Ko(e,n.touched);let s=_1(e,t);if(s.applied)return Ko(e,s.touched);let o=R1(e,t);if(o.kind==="clash")return o;if(o.kind==="merge"){let u=RE(e,t,o.a,o.b);return Ko(e,[u])}let r=T1(e,t);if(r.applied)return Ko(e,r.touched);let i=I1(e,t);if(i.kind==="clash")return i;if(i.kind==="applied")return i.choice&&e.choices.push(i.choice),Ko(e,i.touched);if(i.kind==="split")return i;let a=N1(e,t);if(a.kind==="clash"||a.kind==="split-merge")return a;let c=L1(e,t);if(c.applied)return Ko(e,c.touched);let l=O1(e,t);return l.applied?Ko(e,l.touched):{kind:"done"}}function F1(e){let t=[...e.nodes.values()].map(s=>({id:s.id,parent:s.parent,labels:[...s.labels.entries()].sort((o,r)=>o[0].localeCompare(r[0])).map(([,{expr:o,from:r}])=>({expr:o,from:r}))})),n=e.edges.map(({from:s,r:o,to:r,fromFacts:i})=>({from:s,r:o,to:r,fromFacts:i.slice()}));return{nodes:t,edges:n}}function D1(e,t,n){let s=Zp(n.maxSteps,$E),o=Zp(n.maxBranches,vE),r=Zp(n.maxNodes,xE),i=[e],a=0,c=1,l=[];for(;i.length;){let u=i.pop();if(u.closed){l.push(u.clash);continue}if(u.nodes.size>r)return{status:"exhausted",reason:"nodes",steps:a,branches:c};for(;;){let d=M1(u,t);if(d.kind==="clash"){let p=d.choice?[...u.choices,d.choice]:u.choices.slice();l.push({...d.clash,choices:p});break}if(d.kind==="applied"){if(a+=1,a>s)return{status:"exhausted",reason:"steps",steps:a,branches:c};if(u.nodes.size>r)return{status:"exhausted",reason:"nodes",steps:a,branches:c};continue}if(d.kind==="split"){if(a+=1,a>s)return{status:"exhausted",reason:"steps",steps:a,branches:c};let p=d.disjuncts.map(f=>{let m=hE(u);d.choice&&m.choices.push(d.choice);let h=m.nodes.get(d.node.id);Wn(h,f,d.from);let g=Ll(h);return g&&(m.closed=!0,m.clash={...g,choices:m.choices.slice()}),m});for(let f=p.length-1;f>=0;f-=1){if(c+=1,c>o)return{status:"exhausted",reason:"branches",steps:a,branches:c};i.push(p[f])}break}if(d.kind==="split-merge"){if(a+=1,a>s)return{status:"exhausted",reason:"steps",steps:a,branches:c};let p=d.pairs.map(([f,m])=>{let h=hE(u),g=RE(h,t,f,m),b=h.nodes.get(g),y=b&&Ll(b);return y&&(h.closed=!0,h.clash={...y,choices:h.choices.slice()}),h});for(let f=p.length-1;f>=0;f-=1){if(c+=1,c>o)return{status:"exhausted",reason:"branches",steps:a,branches:c};i.push(p[f])}break}return{status:"satisfiable",model:F1(u),steps:a,branches:c}}if(c>o)return{status:"exhausted",reason:"branches",steps:a,branches:c}}return{status:"unsatisfiable",clashes:l,steps:a,branches:c}}function z1(e,t){let n=new Map,s=i=>(n.has(i)||n.set(i,nm(i,null)),n.get(i));for(let i of e.individuals||[])s(i);for(let i of e.assertions||[])Wn(s(i.ind),i.expr,i.from);for(let i of t||[])!i||!i.ind||!i.expr||Wn(s(i.ind),Qt(i.expr),i.from||[]);for(let[i,a]of e.nominalIndividuals||[])Wn(s(i),{t:"nom",ind:i},a);let o=new Map;for(let i of e.differentFrom||[]){if(!i||!i.a||!i.b||i.a===i.b)continue;let a=la(i.a,i.b),c=o.get(a);o.set(a,Wt(c?[...c,...i.from]:i.from))}let r=[];for(let i of e.roleAssertions||[])s(i.a),s(i.b),r.push({from:i.a,r:i.r,to:i.b,fromFacts:i.from.slice()});return{nodes:n,edges:r,closed:!1,clash:null,inequalityFrom:o,choices:[]}}function sm(e,t=[],n={}){let s=z1(e,t);for(let r of s.nodes.values()){let i=Ll(r);if(i){s.closed=!0,s.clash={...i,choices:[]};break}}let o=D1(s,e,n);return o.status==="exhausted"?{satisfiable:null,exhausted:o.reason,steps:o.steps,branches:o.branches}:o.status==="satisfiable"?{satisfiable:!0,model:o.model,steps:o.steps,branches:o.branches}:{satisfiable:!1,closedClashes:o.clashes,steps:o.steps,branches:o.branches}}function om(e,t,n){let s=sm(e,t,n);if(s.satisfiable===null)return{status:"exhausted",reason:s.exhausted,steps:s.steps,branches:s.branches};if(s.satisfiable===!1){let o=Wt(s.closedClashes.flatMap(l=>l?.premises||[])),r=new Map;for(let l of s.closedClashes)for(let u of l?.choices||[])for(let d of u.cs)r.set(Ge(d),d);let i=[...r.keys()].sort(),a=i.slice(0,SE).map(l=>r.get(l)),c=i.length;return{status:"proved",premises:o,cases:a,casesTotal:c,steps:s.steps,branches:s.branches}}return{status:"disproved",model:s.model,steps:s.steps,branches:s.branches}}function U1(e,t,n,s={}){return om(e,[{ind:t,expr:Qt(ds(n)),from:[]}],s)}function B1(e,t,n,s={}){let o=Qt(bE([ze(t),ds(ze(n))]));return om(e,[{ind:"fresh-0",expr:o,from:[]}],s)}function W1(e,t,n,s={}){let o=Qt(bE([ze(t),ze(n)]));return om(e,[{ind:"fresh-0",expr:o,from:[]}],s)}function G1(e){return e?e.keyA==="bot"?"bottom":`complement:${e.keyA}~${e.keyB}`:"unsatisfiable"}function V1(e){let t=Array.isArray(e)?e.filter(L=>L&&L.subject&&L.predicate):[],n=new Map,s=new Map,o=new Map,r=new Map,i=new Map,a=new Map,c=new Map,l=new Map,u=[],d=[],p=[],f=[],m=new Set,h=[],g=[],b=[],y=[],$=(L,V,W)=>{L.has(V)||L.set(V,[]),L.get(V).push(W)};for(let L of t){let V=String(L.predicate).trim().toLowerCase();V==="owl:onproperty"?n.set(L.subject,{object:L.object,id:L.id}):V==="owl:somevaluesfrom"?s.set(L.subject,{object:L.object,id:L.id}):V==="owl:allvaluesfrom"?o.set(L.subject,{object:L.object,id:L.id}):V==="owl:onclass"?r.set(L.subject,{object:L.object,id:L.id}):V==="owl:mincardinality"?i.set(L.subject,{kind:"min",n:Number(L.object),id:L.id}):V==="owl:maxcardinality"?i.set(L.subject,{kind:"max",n:Number(L.object),id:L.id}):V==="owl:cardinality"?i.set(L.subject,{kind:"exact",n:Number(L.object),id:L.id}):V==="rdfs:subclassof"?u.push(L):V==="owl:disjointwith"?d.push(L):V==="rdf:type"?(p.push(L),String(L.object||"").toLowerCase()==="transitiveproperty"&&m.add(L.subject)):V==="mgxneg:subclassof"?f.push(L):V==="owl:unionof"?$(a,L.subject,L):V==="owl:complementof"?c.set(L.subject,L):V==="rdfs:subpropertyof"?h.push(L):V==="owl:differentfrom"?g.push(L):V==="owl:oneof"?$(l,L.subject,L):V==="owl:inverseof"?b.push(L):y.push(L)}let E=new Set;for(let L of p){let V=String(L.object||"").toLowerCase();em.has(V)||E.add(L.subject)}let _=yE(E,y),v=L=>_.has(L)||wE.test(L),S=y.filter(L=>v(L.subject)&&v(L.object)).sort((L,V)=>L.subject.localeCompare(V.subject)||L.predicate.localeCompare(V.predicate)||L.object.localeCompare(V.object)).slice(0,EE).map(L=>({a:L.subject,r:L.predicate,b:L.object,from:[L.id]})),C=(L,V,W)=>({sub:L,sup:V,from:Wt(W),disjunction:Qt(Qp([ds(L),V]))}),x=[],R=[];for(let L of u){let V=L.object;if(!n.has(V)){x.push(C(ze(L.subject),ze(V),[L.id]));continue}let W=n.get(V),O=s.get(V);if(O){x.push(C(ze(L.subject),b1(W.object,ze(O.object)),[L.id,W.id,O.id]));continue}let D=o.get(V);if(D){x.push(C(ze(L.subject),w1(W.object,ze(D.object)),[L.id,W.id,D.id]));continue}let N=i.get(V),F=r.get(V);if(N&&F){let z=[L.id,W.id,F.id,N.id];N.kind==="min"?x.push(C(ze(L.subject),{t:"atLeast",n:N.n,r:W.object,c:ze(F.object)},z)):N.kind==="max"?x.push(C(ze(L.subject),{t:"atMost",n:N.n,r:W.object,c:ze(F.object)},z)):N.kind==="exact"&&(x.push(C(ze(L.subject),{t:"atLeast",n:N.n,r:W.object,c:ze(F.object)},z)),x.push(C(ze(L.subject),{t:"atMost",n:N.n,r:W.object,c:ze(F.object)},z)))}}for(let L of d)v(L.subject)?R.push({ind:L.subject,expr:Qt(ds(ze(L.object))),from:[L.id]}):x.push(C(ze(L.subject),Qt(ds(ze(L.object))),[L.id]));for(let L of p)em.has(String(L.object||"").toLowerCase())||R.push({ind:L.subject,expr:ze(L.object),from:[L.id]});for(let L of f)R.push({ind:L.subject,expr:Qt(ds(ze(L.object))),from:[L.id]});for(let[L,V]of a){let W=[...V].sort((F,z)=>String(F.object).localeCompare(String(z.object))),O=W.map(F=>ze(F.object)),D=W.map(F=>F.id),N=Qt(Qp(O));x.push(C(ze(L),N,D)),x.push(C(N,ze(L),D))}for(let[L,V]of c){let W=Qt(ds(ze(V.object)));x.push(C(ze(L),W,[V.id])),x.push(C(W,ze(L),[V.id]))}let w=new Map;for(let[L,V]of l){let W=[...V].sort((N,F)=>String(N.object).localeCompare(String(F.object))),O=W.map(N=>({t:"nom",ind:N.object})),D=W.map(N=>N.id);x.push(C(ze(L),Qt(Qp(O)),D));for(let N of W){x.push(C({t:"nom",ind:N.object},ze(L),[N.id]));let F=w.get(N.object);w.set(N.object,F?Wt([...F,N.id]):[N.id])}}let T=g.map(L=>({a:L.subject,b:L.object,from:[L.id]})).sort((L,V)=>L.a.localeCompare(V.a)||L.b.localeCompare(V.b)),I=new Map;for(let L of b)I.set(L.subject,L.object),I.has(L.object)||I.set(L.object,L.subject);let j=new Set;for(let{object:L}of n.values())j.add(L);for(let L of S)j.add(L.r);let k=h.map(L=>[L.subject,L.object]).sort((L,V)=>L[0].localeCompare(V[0])||L[1].localeCompare(V[1])),P=new Set([...j,...k.flat(),...I.keys(),...I.values()]),U=v1(k,P);x.sort((L,V)=>Ge(L.sub).localeCompare(Ge(V.sub))||Ge(L.sup).localeCompare(Ge(V.sup))||L.from.join(",").localeCompare(V.from.join(","))),R.sort((L,V)=>L.ind.localeCompare(V.ind)||Ge(L.expr).localeCompare(Ge(V.expr)));let H=[...new Set([...R.map(L=>L.ind),...S.flatMap(L=>[L.a,L.b])])].sort(),X=new Set(H),Q=new Set([...[...a.values()].flatMap(L=>L.map(V=>V.id)),...[...l.values()].flatMap(L=>L.map(V=>V.id))]);return{axioms:x,assertions:R,roles:[...j].sort(),individuals:H,transitiveRoles:m,roleClosure:U,namedIndividuals:X,nominalIndividuals:w,differentFrom:T,inverseOf:I,roleAssertions:S,unionOrOneOfIds:Q}}function H1(e,t){return{axioms:e.axioms,assertions:(e.assertions||[]).filter(n=>n.ind===t),roles:e.roles,individuals:[t],transitiveRoles:e.transitiveRoles,roleAssertions:e.roleAssertions,roleClosure:e.roleClosure,namedIndividuals:e.namedIndividuals,nominalIndividuals:e.nominalIndividuals,differentFrom:e.differentFrom,inverseOf:e.inverseOf,unionOrOneOfIds:e.unionOrOneOfIds}}function q1(e,t=null,n={}){let s=[...new Set(Array.isArray(t)&&t.length?t:e.individuals||[])].sort(),o=[];for(let r of s){let i=H1(e,r);if(!i.assertions.length)continue;let a=sm(i,[],n);if(a.satisfiable===null||a.satisfiable===!0)continue;let c=Wt(a.closedClashes.flatMap(l=>l?.premises||[]));o.push({subject:r,premises:c,kind:G1(a.closedClashes[0])})}return o.sort((r,i)=>r.subject.localeCompare(i.subject)),o}function us(e,t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)}function K1(e,t,{hops:n=tm}={}){let s=Array.isArray(e)?e.filter(k=>k&&k.subject&&k.predicate):[],o=y1(n,tm),r=new Map,i=new Map,a=new Map,c=new Map,l=new Map,u=new Map,d=new Map,p=new Map,f=new Map,m=new Map,h=new Map,g=[],b=new Map,y=new Set;for(let k of s){if(String(k.predicate).trim().toLowerCase()!=="rdf:type")continue;let P=String(k.object||"").toLowerCase();em.has(P)||y.add(k.subject)}let $=s.filter(k=>!gE.has(String(k.predicate).trim().toLowerCase())),E=yE(y,$),_=k=>E.has(k)||wE.test(k);for(let k of s){let P=String(k.predicate).trim().toLowerCase();P==="rdfs:subclassof"?(us(r,k.subject,k.object),us(i,k.object,k.subject)):P==="owl:onproperty"?a.set(k.subject,k.object):P==="owl:somevaluesfrom"||P==="owl:allvaluesfrom"||P==="owl:onclass"?(c.set(k.subject,k.object),us(l,k.object,k.subject)):P==="owl:unionof"?(us(u,k.subject,k.object),us(d,k.object,k.subject)):P==="owl:complementof"?(p.set(k.subject,k.object),us(f,k.object,k.subject)):P==="owl:oneof"?(us(m,k.subject,k.object),us(h,k.object,k.subject)):!gE.has(P)&&_(k.subject)&&_(k.object)&&(g.push(k),us(b,k.subject,k.object),us(b,k.object,k.subject))}let v=new Map;function S(k){let P=v.get(k);if(P)return P;let U=new Set,H=[...r.get(k)||[],...i.get(k)||[]];for(;H.length;){let X=H.pop();if(!U.has(X)){U.add(X);for(let Q of r.get(X)||[])U.has(Q)||H.push(Q);for(let Q of i.get(X)||[])U.has(Q)||H.push(Q)}}v.set(k,U);for(let X of U)v.has(X)||v.set(X,U);return U}let C=new Set,x=new Map,R=[];function w(k,P){if(!k)return;let U=x.get(k);U!==void 0&&U>=P||(x.set(k,P),R.push({term:k,hopsLeft:P}))}let T=[...new Set((Array.isArray(t)?t:[]).map(k=>q(k)).filter(Boolean))];for(let k of T)w(k,o);let I=0;for(;I<R.length;){let{term:k,hopsLeft:P}=R[I];if(I+=1,x.get(k)===P){C.add(k);for(let U of S(k))C.add(U),w(U,P);if(!(P<=0)){c.has(k)&&w(c.get(k),o);for(let U of l.get(k)||[])w(U,o);for(let U of u.get(k)||[])w(U,P-1);for(let U of d.get(k)||[])w(U,P-1);p.has(k)&&w(p.get(k),P-1);for(let U of f.get(k)||[])w(U,P-1);for(let U of m.get(k)||[])w(U,P-1);for(let U of h.get(k)||[])w(U,P-1);for(let U of b.get(k)||[])w(U,o)}}}let j=new Set;for(let[k,P]of a)C.has(k)&&j.add(fs(P));for(let k of g)(C.has(k.subject)||C.has(k.object))&&j.add(fs(k.predicate));return s.filter(k=>{if(C.has(k.subject)||C.has(k.object))return!0;let P=String(k.predicate).trim().toLowerCase();return P==="rdfs:subpropertyof"||P==="owl:inverseof"||P==="rdf:type"&&String(k.object).toLowerCase()==="transitiveproperty"?j.has(fs(k.subject)):!1})}function X1(e){return(Array.isArray(e)?e:[]).some(n=>{let s=String(n?.predicate||"").trim().toLowerCase();return Y1.has(s)?!0:s==="rdf:type"&&String(n?.object||"").toLowerCase()==="transitiveproperty"})}var ze,ds,bE,Qp,b1,w1,wE,fs,em,$E,vE,xE,x1,tm,EE,SE,E1,gE,Y1,im=M(()=>{it();ze=e=>({t:"atom",name:e}),ds=e=>({t:"not",c:e}),bE=e=>({t:"and",cs:e}),Qp=e=>({t:"or",cs:e}),b1=(e,t)=>({t:"some",r:e,c:t}),w1=(e,t)=>({t:"all",r:e,c:t});wE=/[./\\#:@]/;fs=e=>q(e);em=new Set(["restriction","transitiveproperty","class"]),$E=5e3,vE=256,xE=512,x1=.95,tm=4,EE=256,SE=6,E1=/\.\d+$/;gE=new Set(["owl:onproperty","owl:somevaluesfrom","owl:allvaluesfrom","owl:onclass","owl:mincardinality","owl:maxcardinality","owl:cardinality","rdfs:subclassof","owl:disjointwith","rdf:type","mgxneg:subclassof","owl:unionof","owl:complementof","rdfs:subpropertyof","owl:differentfrom","owl:oneof","owl:inverseof"]);Y1=new Set(["owl:unionof","owl:complementof","owl:oneof","owl:allvaluesfrom","owl:mincardinality","owl:maxcardinality","owl:cardinality","rdfs:subpropertyof","owl:inverseof"])});var NE={};Nt(NE,{BOT:()=>un,DEFAULT_EL_BUDGET:()=>dm,DEFAULT_EL_ROUNDS:()=>fm,EL_RESTRICTION_RULE:()=>um,EL_RULE_CONFIDENCE:()=>am,EL_SUBSUMPTION_RULE:()=>lm,ENTAILED_EL_PROVENANCE:()=>IE,ENTAILED_EL_RESTRICTION_PROVENANCE:()=>da,TOP:()=>fo,classifyEl:()=>dP,elGoalAxioms:()=>AE,elGoalFor:()=>CE,elUnsatisfiableClasses:()=>uP,normalizeElTBox:()=>cm,proveElSubsumption:()=>lP,saturateEl:()=>Ml});function J1(e,t,n){for(let s of t)if(typeof e?.[s]!="function")throw new TypeError(`${n} needs a store option carrying { ${t.join(", ")} } (memory/core.mjs's read/write functions) \u2014 missing ${s}`);return e}function Q1(e){if(!e)return null;let t=e instanceof Set?[...e]:Array.isArray(e)?e:[],n=new Set;for(let s of t){let o=q(s);o&&n.add(o)}return n.size?n:null}function cm(e,{budget:t=500}={}){let s=[...(Array.isArray(e)?e:[]).filter(w=>w&&w.id&&w.subject&&w.predicate&&w.object!==void 0&&w.object!==null)].sort((w,T)=>String(w.id).localeCompare(String(T.id))),o=s.length>t,r=o?s.slice(0,t):s,i=new Set,a=new Set,c=w=>{w&&w!==fo&&w!==un&&i.add(w)},l=new Map,u=new Map,d=new Map,p=new Map,f=new Map,m=new Map,h=[],g=[],b=new Map,y=[];for(let w of r){if(w.subject===fo||w.subject===un||w.object===fo||w.object===un)continue;let T=w.predicate;tP(T)?(l.set(w.subject,w),c(w.subject)):nP(T)?(u.set(w.subject,w),c(w.subject),c(w.object)):sP(T)?d.set(w.subject,w):oP(T)?(p.set(w.subject,w),c(w.subject),c(w.object)):cP(T)?(f.set(w.subject,w),c(w.subject)):rP(T)?(m.has(w.subject)||m.set(w.subject,[]),m.get(w.subject).push(w),c(w.subject),c(w.object)):TE(T)?(h.push(w),c(w.subject),c(w.object)):eP(T)?(g.push(w),c(w.subject),c(w.object)):Z1(T)&&w.object==="transitiveproperty"?(b.has(w.subject)||b.set(w.subject,w),a.add(w.subject)):iP(T)&&(y.push(w),a.add(w.subject),a.add(w.object))}let $=new Set([...l.keys()].filter(w=>u.has(w))),E=new Set([...l.keys()].filter(w=>d.has(w)));for(let w of E)i.delete(w);let _=new Map;for(let w of $)_.set(w,{role:l.get(w).object,filler:u.get(w).object});let v=new Map;for(let w of Nd(r))w.kind!=="min"&&w.kind!=="exactly"||w.n>=1&&($.has(w.restriction)||!l.has(w.restriction)||!p.has(w.restriction)||!f.has(w.restriction)||(v.set(w.restriction,w.onClass),_.set(w.restriction,{role:"has",filler:w.onClass})));let S=new Set(m.keys()),C=[],x=new Map;for(let w of h){let T=w.subject,I=w.object;if(S.has(T)){x.has(T)||x.set(T,w);continue}if($.has(I)){let{role:j,filler:k}=_.get(I),P=l.get(I),U=u.get(I);C.push({form:"someRight",sub:T,role:j,filler:k,from:[w.id,P.id,U.id]}),C.push({form:"someLeft",role:j,filler:k,sup:I,from:[P.id,U.id]});continue}if(v.has(I)){let j=v.get(I),k=l.get(I),P=p.get(I),U=f.get(I);C.push({form:"someRight",sub:T,role:"has",filler:j,from:[w.id,k.id,P.id,U.id]}),C.push({form:"someLeft",role:"has",filler:j,sup:I,from:[k.id,P.id,U.id]});continue}E.has(I)||C.push({form:"sub",sub:T,sup:I,from:[w.id]})}for(let[w,T]of m){let I=x.get(w);if(!I)continue;let j=new Map;for(let H of T)j.has(H.object)||j.set(H.object,H);let k=[...j.keys()].sort();if(k.length<2)continue;let P=k[0],U=[j.get(k[0]).id];for(let H=1;H<k.length;H+=1){let X=k[H],Q=H===k.length-1,L=Q?I.object:`${P}-and-${X}`,V=[P,X].sort(),W=j.get(X).id,O=Q?[...U,W,I.id]:[...U,W];C.push({form:"and",subs:V,sup:L,from:O}),U=[...U,W],P=L}}for(let w of g)C.push({form:"and",subs:[w.subject,w.object].sort(),sup:un,from:[w.id]});let R=[];for(let w of[...b.keys()].sort())R.push({kind:"transitive",role:w,from:[b.get(w).id]});for(let w of[...y].sort((T,I)=>`${T.subject}${ue}${T.object}`.localeCompare(`${I.subject}${ue}${I.object}`)))R.push({kind:"sub",sub:w.subject,sup:w.object,from:[w.id]});return{axioms:C,roleAxioms:R,concepts:i,roles:a,restrictionOf:_,truncated:o}}function Ml(e,{budget:t=2e3,rounds:n=64,focus:s=null}={}){let o=e?.axioms||[],r=e?.roleAxioms||[],i=[...e?.concepts||[]].sort(),a=s instanceof Set?s.size?s:null:Q1(s),c=(...w)=>!a||w.some(T=>a.has(T)),l=new Map,u=new Map,d=new Map,p=new Map;for(let w of o)if(w.form==="sub")l.has(w.sub)||l.set(w.sub,[]),l.get(w.sub).push({sup:w.sup,from:w.from});else if(w.form==="and"){let[T,I]=w.subs;for(let[j,k]of[[T,I],[I,T]])u.has(j)||u.set(j,[]),u.get(j).push({other:k,sup:w.sup,from:w.from})}else if(w.form==="someRight")d.has(w.sub)||d.set(w.sub,[]),d.get(w.sub).push({role:w.role,filler:w.filler,from:w.from});else if(w.form==="someLeft"){let T=`${w.role}${ue}${w.filler}`;p.has(T)||p.set(T,[]),p.get(T).push({sup:w.sup,from:w.from})}let f=new Map,m=new Set,h=new Map;for(let w of r)w.kind==="sub"?(f.has(w.sub)||f.set(w.sub,[]),f.get(w.sub).push({sup:w.sup,from:w.from})):w.kind==="transitive"&&(m.add(w.role),h.has(w.role)||h.set(w.role,w.from));let g=new Map;for(let w of i)g.set(w,new Set([w,fo]));let b=new Map,y=new Map,$=new Map,E=(w,T)=>w===T?[]:y.get(`${w}${ue}${T}`)||[],_=(w,T)=>$.get(`${w}${ue}${T}`)||[],v=(...w)=>{let T=new Set,I=[];for(let j of w)for(let k of j||[])!k||T.has(k)||(T.add(k),I.push(k));return I},S=0,C=!1,x=0;for(let w=0;w<n;w+=1){x+=1;let T=[];for(let[j,k]of g)for(let P of k)for(let{sup:U,from:H}of l.get(P)||[])k.has(U)||c(j,P,U)&&T.push({kind:"sub",A:j,X:U,from:v(E(j,P),H),sortKey:`1${ue}${j}${ue}${U}${ue}${P}`});for(let[j,k]of g)for(let P of k)for(let{other:U,sup:H,from:X}of u.get(P)||[])k.has(U)&&(k.has(H)||c(j,P,U,H)&&T.push({kind:"sub",A:j,X:H,from:v(E(j,P),E(j,U),X),sortKey:`2${ue}${j}${ue}${H}${ue}${[P,U].sort().join(ue)}`}));for(let[j,k]of g)for(let P of k)for(let{role:U,filler:H,from:X}of d.get(P)||[]){let Q=`${j}${ue}${H}`;(b.get(U)||ua).has(Q)||c(j,P,H)&&T.push({kind:"role",role:U,A:j,B:H,from:v(E(j,P),X),sortKey:`3${ue}${U}${ue}${j}${ue}${H}${ue}${P}`})}for(let[j,k]of b)for(let P of k){let[U,H]=P.split(ue),X=g.get(H)||ua;for(let Q of X)for(let{sup:L,from:V}of p.get(`${j}${ue}${Q}`)||[]){let W=g.get(U);!W||W.has(L)||c(U,H,Q,L)&&T.push({kind:"sub",A:U,X:L,from:v(_(j,P),E(H,Q),V),sortKey:`4${ue}${U}${ue}${L}${ue}${j}${ue}${H}${ue}${Q}`})}}for(let[j,k]of b)for(let P of k){let[U,H]=P.split(ue);if(!(g.get(H)||ua).has(un))continue;let X=g.get(U);!X||X.has(un)||c(U,H)&&T.push({kind:"sub",A:U,X:un,from:v(_(j,P),E(H,un)),sortKey:`5${ue}${U}${ue}${j}${ue}${H}`})}for(let[j,k]of b)for(let{sup:P,from:U}of f.get(j)||[])for(let H of k){if((b.get(P)||ua).has(H))continue;let[X,Q]=H.split(ue);c(X,Q)&&T.push({kind:"role",role:P,A:X,B:Q,from:v(_(j,H),U),sortKey:`6${ue}${P}${ue}${X}${ue}${Q}${ue}${j}`})}for(let j of[...m].sort()){let k=b.get(j);if(k)for(let P of k){let[U,H]=P.split(ue);for(let X of k){let[Q,L]=X.split(ue);if(Q!==H)continue;let V=`${U}${ue}${L}`;k.has(V)||c(U,H,L)&&T.push({kind:"role",role:j,A:U,B:L,from:v(_(j,P),_(j,X),h.get(j)),sortKey:`7${ue}${j}${ue}${U}${ue}${L}${ue}${H}`})}}}if(!T.length){C=!0;break}T.sort((j,k)=>j.sortKey<k.sortKey?-1:j.sortKey>k.sortKey?1:0);let I=!1;for(let j of T){if(S>=t)break;if(j.kind==="sub"){let k=g.get(j.A);if(!k||k.has(j.X))continue;k.add(j.X),y.set(`${j.A}${ue}${j.X}`,j.from),S+=1,I=!0}else{b.has(j.role)||b.set(j.role,new Set);let k=b.get(j.role),P=`${j.A}${ue}${j.B}`;if(k.has(P))continue;k.add(P),$.set(`${j.role}${ue}${P}`,j.from),S+=1,I=!0}}if(S>=t)break;if(!I){C=!0;break}}let R=[...g.entries()].filter(([,w])=>w.has(un)).map(([w])=>w).sort();return{subsumers:g,roleEdges:b,unsatisfiable:R,derivationOf:y,rounds:x,truncated:!C}}function AE(e,t,{budget:n=200}={}){let o=[...(e?.axioms||[]).filter(a=>a.form==="someRight")].sort((a,c)=>{let l=`${a.role}${ue}${a.filler}${ue}${a.sub}`,u=`${c.role}${ue}${c.filler}${ue}${c.sub}`;return l<u?-1:l>u?1:0}),r=[],i=new Set;for(let a of o){let l=[...t?.get(a.filler)||new Set([a.filler,fo])].filter(u=>u!==fo&&u!==un).sort();for(let u of l){let d=`some-${a.role}-${u}`;if(!i.has(d)&&(i.add(d),r.push({form:"someLeft",role:a.role,filler:u,sup:d,from:[]}),r.length>=n))return r}}return r}function CE(e,t){let n=q(e),s=q(t),o=`some-${n}-${s}`;return{axiom:{form:"someLeft",role:n,filler:s,sup:o,from:[]},name:o}}function lP(e,t,{role:n,filler:s},{budget:o=2e3,rounds:r=64}={}){let i=q(t),a=cm(e,{budget:o}),{axiom:c,name:l}=CE(n,s),u=new Set(a.concepts);u.add(i),u.add(c.filler);let d={...a,axioms:[...a.axioms,c],concepts:u},p=Ml(d,{budget:o,rounds:r});return(p.subsumers.get(i)||ua).has(l)?{proved:!0,premises:p.derivationOf.get(`${i}${ue}${l}`)||[]}:{proved:!1,exhausted:p.truncated}}function OE(e,{budget:t=dm,rounds:n=fm,focus:s=null}={}){let o=cm(e,{budget:t}),r=Ml(o,{budget:t,rounds:n,focus:s}),i=AE(o,r.subsumers),a=new Map(i.map(d=>[d.sup,{role:d.role,filler:d.filler}])),c={...o,axioms:[...o.axioms,...i]},l=Ml(c,{budget:t,rounds:n,focus:s}),u=o.truncated||r.truncated||l.truncated;return{normalized:o,goals:i,goalInfo:a,finalPass:l,truncated:u}}function uP(e,t={}){let{finalPass:n,truncated:s}=OE(e,t);return{unsatisfiable:n.unsatisfiable,premisesOf:o=>n.derivationOf.get(`${o}${ue}${un}`)||[],truncated:s}}async function dP(e,{budget:t=dm,rounds:n=fm,focus:s=null,maxEnvironments:o=xr,store:r}={}){let{loadMemory:i,readFactRows:a,appendFacts:c}=J1(r,["loadMemory","readFactRows","appendFacts"],"classifyEl"),l=await i(e),u=a(l),{normalized:d,goals:p,goalInfo:f,finalPass:m,truncated:h}=OE(u,{budget:t,rounds:n,focus:s}),g=new Map;for(let R of u)g.set(`${R.subject}${ue}${R.predicate}${ue}${R.object}`,R.trust);let b=new Map(u.map(R=>[R.id,R])),y=R=>(R||[]).map(w=>b.get(w)?.trust).filter(w=>typeof w=="number"),$=new Set(u.filter(R=>TE(R.predicate)).map(R=>`${R.subject}${ue}${R.object}`)),E=[],_=[],v=new Set,S=[...m.subsumers.keys()].sort();for(let R of S){let w=m.subsumers.get(R);if(w.has(un))continue;let T=[...w].filter(I=>I!==R&&I!==fo&&I!==un).sort();for(let I of T){let j=`${R}${ue}${I}`;if($.has(j))continue;let k=m.derivationOf.get(j)||[],P=f.get(I);if(P){v.has(I)||(v.add(I),E.push({subject:I,predicate:Dt,object:"owl:Restriction",provenance:da,justification:[k]}),E.push({subject:I,predicate:jn,object:P.role,provenance:da,justification:[k]}),E.push({subject:I,predicate:kn,object:P.filler,provenance:da,justification:[k]}));let U=y(k),H=E.length;E.push({subject:R,predicate:Be,object:I,provenance:da,justification:[k],...U.length?{premiseTrusts:U,ruleConfidence:am}:{}}),_.push({toWriteIndex:H,subject:R,object:I,rule:um})}else if(d.concepts.has(I)){let U=y(k),H=E.length;E.push({subject:R,predicate:Be,object:I,provenance:IE,justification:[k],...U.length?{premiseTrusts:U,ruleConfidence:am}:{}}),_.push({toWriteIndex:H,subject:R,object:I,rule:lm})}}}let{ids:C}=await c(e,E),x=_.map(R=>({id:C[R.toWriteIndex],subject:R.subject,object:R.object,rule:R.rule}));return{derived:x,count:x.length,budget:t,rounds:n,truncated:h,unsatisfiable:m.unsatisfiable,goalCount:p.length}}var ue,fo,un,ps,TE,Z1,eP,tP,nP,sP,oP,rP,iP,aP,cP,ua,lm,IE,um,da,am,dm,fm,LE=M(()=>{it();It();ue="\u241F",fo="top",un="bot";ps=e=>String(e||"").trim().toLowerCase(),TE=e=>ps(e)==="rdfs:subclassof",Z1=e=>ps(e)==="rdf:type",eP=e=>ps(e)==="owl:disjointwith",tP=e=>ps(e)==="owl:onproperty",nP=e=>ps(e)==="owl:somevaluesfrom",sP=e=>ps(e)==="owl:allvaluesfrom",oP=e=>ps(e)==="owl:onclass",rP=e=>ps(e)==="owl:intersectionof",iP=e=>ps(e)==="rdfs:subpropertyof",aP=new Set(["owl:cardinality","owl:mincardinality","owl:maxcardinality"]),cP=e=>aP.has(ps(e));ua=new Set;lm="elSubsumption",IE=`entailed:${lm}`,um="elRestriction",da=`entailed:${um}`,am=.95,dm=2e3,fm=64});var PE={};Nt(PE,{DEFAULT_REASONING_CONFIG:()=>Fl,resolveReasoningConfig:()=>gP});function mP(e,t){let n=Number(e);return Number.isInteger(n)&&n>0?n:t}function hP(e,t){return typeof e=="boolean"?e:t}function gP(e){let t=e?.reasoning||{},n={...Fl};for(let[s,o]of Object.entries(fP))t[s]!==void 0&&(n[o]=mP(t[s],Fl[o]));for(let[s,o]of Object.entries(pP))t[s]!==void 0&&(n[o]=hP(t[s],Fl[o]));return n}var Fl,fP,pP,ME=M(()=>{Fl=Object.freeze({syllogiseBudget:50,syllogiseDepth:32,classifyBudget:2e3,classifyRounds:64,maxEnvironments:4,proveSteps:5e3,proveBranches:256,proveNodes:512,askProveFallback:!0,askProveSteps:1e3,askProveBranches:64,askProveNodes:128}),fP=Object.freeze({syllogise_budget:"syllogiseBudget",syllogise_depth:"syllogiseDepth",classify_budget:"classifyBudget",classify_rounds:"classifyRounds",max_environments:"maxEnvironments",prove_steps:"proveSteps",prove_branches:"proveBranches",prove_nodes:"proveNodes",ask_prove_steps:"askProveSteps",ask_prove_branches:"askProveBranches",ask_prove_nodes:"askProveNodes"}),pP=Object.freeze({ask_prove_fallback:"askProveFallback"})});function Em(e){if(!e)return null;let{node:t,shape:n,kind:s}=e;if(t==="find")return`locate a specific named entity ("${e.term}")`;if(t==="count")return`get a count of ${Dl(e.entityType)}`;if(t==="list")return`list/enumerate ${Dl(e.entityType)} matching a condition`;if(t==="superlative")return`rank/compare ${Dl(e.entityType)} by ${e.metricNoun||e.metric||"a metric"}`;if(t==="anaphora")return"follow up on the previous answer's result set (discourse anaphora)";if(t==="membership")return`understand "${e.term||"an entity"}"'s membership/relationship`;if(t==="clause")return Em(e.clause);if(t==="miss")return null;if(t==="boolean"||t==="qualifier"||t==="reverseSet"||t==="forwardSet"||t==="allOfClass"||t==="temporal"){let o=s||e.inner?.kind;return o&&In[o]?In[o]:`filter/traverse ${Dl(e.entityType)} by a relationship`}return n==="meta"?`understand a vocabulary/definition term ("${e.object}")`:n==="where"?`locate where something is defined ("${e.object}")`:n==="when"?"understand when something last changed (history)":n==="whoLast"?"find who most recently touched something (history)":n==="mentions"?`find where something is mentioned in prose ("${e.object}")`:n==="ask"?s&&In[s]||"check a specific subject/object relationship":(n==="reverse"||n==="forward")&&s?In[s]||`understand a "${s}" relationship`:"understand a graph relationship"}function Tm(e){let t=new Map;for(let n of e)t.has(zE(n))||t.set(zE(n),n);return t}function mm(e,t=Xo){let n=[],s=[];for(let c of e)c.predicate===t&&(s.push([c.subject,c.object]),Yo(c)&&n.push([c.subject,c.object]));let o=new Map,r=new Map,i=new Set,a=(c,l,u)=>{!l||!u||l===u||(c.has(l)||c.set(l,new Set),c.get(l).add(u))};for(let[c,l]of s)a(r,c,l),l&&i.add(l);for(let[c,l]of n)a(o,c,l);return{strictEdges:n,broadEdges:s,strictSucc:o,broadSucc:r,reachableHeads:i}}function hm(e,t,n,s,o){let r=s.reachableHeads,i=!1;for(let a of n)if(r.has(a)){i=!0;break}return i?e(t,n,[],s.strictSucc,o)||e(t,n,[],s.broadSucc,o):null}function SP(e,t){return!/ves$/i.test(e)||!/fe?$/i.test(t)?t:e.slice(0,-1)}async function jP(e){let t=String(e||"").toLowerCase();try{let{proseLemma:n}=await Promise.resolve().then(()=>(uE(),lE)),s=n();return s?SP(t,s(t)):t}catch{return t}}function Cm(e){let t=String(e||"").trim();if(/[a-z]ies$/i.test(t))return`${t.slice(0,-3)}y`;if(/[a-z]ses$/i.test(t)){let n=t.slice(0,-2);return/ss$/i.test(n)||kP.has(n.toLowerCase())?n:t.slice(0,-1)}return/(xes|zes|ches|shes)$/i.test(t)?t.slice(0,-2):/[a-z]s$/i.test(t)&&!/(?:ss|ous)$/i.test(t)?t.slice(0,-1):t}async function Vl(e){let t=String(e||"").toLowerCase();if(t==="has"||t==="have")return Mr;if(t==="can")return"mgx:capableOf";try{let n=await jP(t);return n==="have"?Mr:Zn(`mgx:${n}`)}catch{return Zn(`mgx:${t}`)}}function OP(e,t){let n=String(t||"").match(IP);return n&&/^mgx:[a-z]+$/.test(e)?{predicate:`${e}-${n[1].toLowerCase()}`,object:n[2].trim()}:{predicate:e,object:String(t||"").trim()}}async function fa(e,t){if(!e||!t)return null;try{let{resolveObject:n}=await Promise.resolve().then(()=>(Jn(),Hb)),s=n(e,t);if(s?.match?.id&&!s.ambiguous)return{id:s.match.id,label:s.match.label}}catch{}return null}function WE(e){return e.predicate===xP&&e.object==="transitiveproperty"||e.predicate===pS}function DP(e){let t=String(e||"");return/^have$/i.test(t)?"has":/[a-z]y$/i.test(t)&&!/[aeiou]y$/i.test(t)?`${t.slice(0,-1)}ies`:/(?:s|x|z|ch|sh|o)$/i.test(t)?`${t}es`:`${t}s`}function Xl(e){let t=String(e||"");return/^has$/i.test(t)?"have":/[a-z]ies$/i.test(t)&&!/[aeiou]ies$/i.test(t)?`${t.slice(0,-3)}y`:/(?:s|x|z|ch|sh|o)es$/i.test(t)?t.slice(0,-2):t.replace(/s$/i,"")}function VE(e){let t=Xl(e);return/[^aeiou]e$/i.test(t)&&t.length>2?`${t.slice(0,-1)}ing`:`${t}ing`}function yS(e){if(Fs[e])return Fs[e];let t=String(e||""),n=gw(t);if(n){let a=yS(n);if(a==="can")return"cannot";if(a==="can be")return"cannot be";if(a==="is"||a.startsWith("is "))return`is not${a.slice(2)}`;let[c,...l]=a.split(" ");return["does not",Xl(c),...l].join(" ")}let s=/^mgx:([a-z]+(?:-[a-z]+)*)-than$/i.exec(t);if(s)return`is ${s[1].replace(/-/g," ")} than`;let o=new RegExp(`^mgx:(${Im})-([a-z]+)$`,"i").exec(t);if(o)return`is ${o[1].toLowerCase()} ${o[2].toLowerCase()}`;let r=/^mgx:same-([a-z]+)-as$/i.exec(t);if(r)return`has the same ${r[1].toLowerCase()} as`;let i=/^mgx:([a-z]+)(?:-([a-z]+))?$/i.exec(t);return i?`${DP(i[1])}${i[2]?` ${i[2]}`:""}`:e}function ym(e){let t=/^mgx:([a-z][\w-]*)$/i.exec(String(e||""));return t?t[1].toLowerCase():null}function UP(e){let t=String(e||"").trim(),n=t.toLowerCase();for(let{marker:s,predicate:o}of zP)if(n!==s&&n.endsWith(` ${s}`)){let r=t.slice(0,t.length-s.length).trim();if(r)return{subject:r,predicate:o}}return{subject:t,predicate:null}}function ms(e){return e.replace(/#node:[0-9a-f]+/g,"")}function oe(e){let t=e.provenance?` (source: ${ms(e.provenance)})`:"";return e.predicate===pS?`${VE(e.subject)} implies ${VE(e.object)}${t}`:e.provenance.includes("ace:chat")||e.provenance.includes("teach:chat")?`you told me: ${Zt(e)}${t}`:e.provenance.includes("corpus-weak:")?`possibly: ${Zt(e)}${t}`:e.provenance.includes("corpus:")?`${Zt(e)}${t}`:e.provenance.includes("reference:")?`${Zt(e)}${t}`:`i learned: ${Zt(e)}${t}`}function HE(e,t,n,{toward:s=null}={}){let o=oe(e);if(!On.has(e.predicate)||!n.has(e.subject))return o;let r=pl(e.object,t,{cap:6,stopAt:dl,toward:s});if(r.length<=1)return o;let i=` \u2192 ${r.slice(1).join(" \u2192 ")}`,a=o.match(BP);return a?o.slice(0,a.index)+i+a[0]:o+i}function qE(e,t,n,{indent:s=""}={}){let o=t.filter(_=>_.predicate===Xo).map(_=>[_.subject,_.object]),r=ta(o),i=e.map(_=>`${s}${HE(_,r,n)}`),a=e.filter(_=>On.has(_.predicate)&&n.has(_.subject)),c=[...new Set(a.map(_=>_.object))];if(c.length<2)return{lines:i,grouped:null};let l=t.filter(_=>_.predicate==="owl:disjointWith").map(_=>[_.subject,_.object]),{split:u,clusters:d}=ml(c,{parents:r,disjointEdges:l});if(!u)return{lines:i,grouped:null};let p=a[0].subject,f=new Map;for(let _ of d)for(let v of _.objects)f.set(v,_);let m=e.filter(_=>!(On.has(_.predicate)&&n.has(_.subject))),h=[],g=[],b=0,y=_=>{let v=HE(_,r,n);return b<Re?(b+=1,`${s}${v}`):(g.push(v),null)};for(let _ of d){let v=a.filter(S=>f.get(S.object)===_).map(y).filter(Boolean);v.length&&h.push(`${s}${p}, the ${_.label}:
164
+ `)}`:l,data:{...a,grounded:c}})}finally{await i()}}var nv=M(()=>{Je();qe();tt();np.ownsGraphLoad=!0});var YO,sv=M(()=>{Rd();nw();Vy();qy();Yy();Jy();Zy();t$();s$();r$();j$();R$();T$();C$();qc();P$();F$();z$();B$();G$();H$();K$();X$();Q$();tv();nv();YO=Object.freeze({tmct_context:kd,tmct_context_more:tw,tmct_describe:Gy,tmct_snippet:Hy,tmct_signature:Ky,tmct_impact:Xy,tmct_search:Qy,tmct_members:e$,tmct_subclasses:n$,tmct_related:Xf,tmct_sprite:ep,tmct_architecture:k$,tmct_exports:_$,tmct_untested:A$,tmct_ask:N$,tmct_tests_for:L$,tmct_history:M$,tmct_file_history:D$,tmct_method_history:U$,tmct_class_history:W$,tmct_callers:V$,tmct_callees:q$,tmct_calls:Y$,tmct_cochanges:J$,tmct_export:tp,tmct_ingest:np})});var sp=M(()=>{});var Kc,op=M(()=>{Kc=()=>({relations:[],constructions:[]})});var ov,rv=M(()=>{Pt();Je();ih();Kt();ni();Jn();sc();oc();sv();qc();tt();gr();Ga();sp();op();oc();Rd();qc();Va(void 0);Wa(Kc);ov=rh.map(({name:e,agentDescription:t,inputSchema:n})=>({name:e,description:t,inputSchema:n}))});var Fs,ip=M(()=>{Fs=Object.freeze({"rdfs:subClassOf":"is a kind of","mgxneg:subClassOf":"is not a kind of","rdf:type":"is a","owl:disjointWith":"is not a","owl:unionOf":"is either","owl:complementOf":"is anything that is not","owl:oneOf":"includes exactly","owl:differentFrom":"is not the same as","mgx:partOf":"is part of","mgx:memberOf":"is a member of","mgx:collectionOf":"is a collection of","mgx:hasA":"has","mgx:usedFor":"is used for","mgx:capableOf":"can","mgx:atLocation":"is found in","mgx:causes":"causes","mgx:hasProperty":"is","mgx:madeOf":"is made of","mgx:receivesAction":"can be","mgx:createdBy":"is created by","mgx:mannerOf":"is a way to","mgx:desires":"wants","mgx:locatedNear":"is typically near","mgx:motivatedByGoal":"is motivated by","mgx:obstructedBy":"can be prevented by","mgx:causesDesire":"makes you want to","mgx:hasSubevent":"involves","mgx:hasFirstSubevent":"begins with","mgx:hasLastSubevent":"ends with","mgx:hasPrerequisite":"requires","mgx:ownedBy":"is owned by","mgx:rendersAs":"renders as","mgx:synonym":"means the same as","mgx:antonym":"is the opposite of","mgx:similarTo":"is similar to","mgx:relatedTo":"is related to","mgx:symbolOf":"is a symbol of","mgx:currently-in":"is in","mgx:located-in":"is in","mgx:fixed-in":"is fixed in","mgx:stands-locked-in":"stands locked in","mgx:works-in":"works in","mgx:pursues":"pursues","mgx:evades":"evades","mgx:consumes":"eats","mgx:vision-radius":"sees within","mgx:guards":"guards"})});var xG,EG,SG,Yc=M(()=>{xG=Object.freeze(["entity","set","event","measure"]),EG=Object.freeze(["date","count","op","pivot","metric","kind","provenance"]),SG=Object.freeze({it:Object.freeze(["entity","event","measure"]),this:Object.freeze(["entity","event","measure"]),that:Object.freeze(["entity","event","measure"]),"this one":Object.freeze(["entity","event","measure"]),"that one":Object.freeze(["entity","event","measure"]),those:Object.freeze(["set"]),them:Object.freeze(["set"]),these:Object.freeze(["set"]),here:Object.freeze(["entity"])})});var Xc=M(()=>{});var St,RG,_G,TG,AG,CG,IG,OG,NG,LG,PG,MG,FG,DG,zG,UG,BG,qt,WG,GG,VG,co=M(()=>{St=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},RG=St("createRequire"),_G=St("readFileSync"),TG=St("access"),AG=St("readFile"),CG=St("writeFile"),IG=St("appendFile"),OG=St("mkdir"),NG=St("mkdtemp"),LG=St("rename"),PG=St("unlink"),MG=St("rm"),FG=St("stat"),DG=St("copyFile"),zG=St("readdir"),UG=St("createReadStream"),BG=St("createWriteStream"),qt=e=>String(e),WG=St("randomBytes"),GG=St("spawnSync"),VG=St("createInterface")});var pv={};Lt(pv,{PHRASEBOOK_FILE:()=>cv,TECHNICAL_SLOTS:()=>ap,TEMPLATES_FILE:()=>av,flatten:()=>lp,loadPhrasebook:()=>ZO,loadTemplates:()=>up,loadTemplatesMerged:()=>QO,render:()=>fv,renderSegments:()=>dv,slotKind:()=>uv,slotsOf:()=>cp});function cp(e){let t=[];for(let n of String(e).matchAll(lv))t.includes(n[1])||t.push(n[1]);return t}function uv(e){return JO[e]||"entity"}function lp(e){let t="";for(let n of e)t+=n.text;return t}function dv(e,t={},n=qi){if(!n)throw new Error("renderSegments() before loadTemplates() \u2014 load the template library first");let s=n.get(e);if(!s)throw new Error(`unknown template id "${e}"`);let o=s.slots.filter(u=>t[u]===void 0||t[u]===null);if(o.length)throw new Error(`template "${e}" missing slot${o.length>1?"s":""}: ${o.join(", ")}`);let r=s.template,i=new RegExp(lv.source,"g"),a=[],c=0,l;for(;(l=i.exec(r))!==null;)l.index>c&&a.push({type:"prose",text:r.slice(c,l.index)}),a.push({type:uv(l[1]),text:String(t[l[1]])}),c=l.index+l[0].length;return c<r.length&&a.push({type:"prose",text:r.slice(c)}),a}async function up(e=av){let t=await Ie(e,"utf8"),n=new Map,s=t.split(`
165
+ `);for(let o=0;o<s.length;o+=1){let r=s[o].trim();if(!r)continue;let i;try{i=JSON.parse(r)}catch(c){throw new Error(`${e}:${o+1}: not valid JSON: ${c.message}`)}for(let c of["id","class","template","register"])if(typeof i[c]!="string"||!i[c])throw new Error(`${e}:${o+1}: missing/empty "${c}"`);if(!XO.has(i.register))throw new Error(`${e}:${o+1}: register must be terse|friendly|technical, got "${i.register}"`);if(n.has(i.id))throw new Error(`${e}:${o+1}: duplicate template id "${i.id}"`);let a=cp(i.template);if(i.register==="technical"){let c=a.filter(l=>!ap.has(l));if(c.length)throw new Error(`${e}:${o+1}: technical template "${i.id}" uses non-mechanical slot${c.length>1?"s":""}: ${c.join(", ")} (allowed: ${[...ap].join(", ")})`);if(!a.includes("provenance"))throw new Error(`${e}:${o+1}: technical template "${i.id}" must carry a {provenance} fill (an advanced claim always shows its source)`)}n.set(i.id,{...i,slots:a})}return qi=n,n}async function QO(e=[]){let t=qi,n=new Map;try{for(let s of e){let o=await up(s);for(let[r,i]of o){if(!r.includes(":"))throw new Error(`${s}: extension-pack template id "${r}" is not namespaced ("<packname>:<id>")`);if(n.has(r))throw new Error(`${s}: duplicate template id "${r}" already loaded from an earlier path`);n.set(r,i)}}}finally{qi=t}return n}function fv(e,t={},n=qi){if(!n)throw new Error("render() before loadTemplates() \u2014 load the template library first");return lp(dv(e,t,n))}async function ZO(e=cv){let t=await Ie(e,"utf8"),n=[],s=[],o=t.split(`
166
+ `);for(let r=0;r<o.length;r+=1){let i=o[r].trim();if(!(!i||i.startsWith("#"))){if(i.startsWith("~")){let a=i.slice(1).split(",").map(c=>c.trim().toLowerCase()).filter(Boolean);if(a.length<2)throw new Error(`${e}:${r+1}: a synonym family needs at least 2 entries`);s.push(a);continue}n.push({pattern:i,slots:cp(i)})}}return{patterns:n,synonyms:s}}var eN,iv,av,cv,XO,lv,ap,JO,qi,Jc=M(()=>{Pt();co();Je();eN={},iv=ne(ye(qt(eN.url)),"..","..",".."),av=ne(iv,"data","templates","responses.jsonl"),cv=ne(iv,"data","phrasebook","software-phrases.txt"),XO=new Set(["terse","friendly","technical"]),lv=/\{([A-Za-z][A-Za-z0-9]*)\}/g,ap=Object.freeze(new Set(["subject","count","noun","scope","comparison","metric","unit","superlative","provenance"]));JO={count:"number",when:"number",location:"path",commit:"path",provenance:"provenance"};qi=null});function nN(e,t={}){let n=tN.exec(String(e||""));if(!n)return 1;let s=t?.[n[1]];return typeof s=="number"&&Number.isFinite(s)?s:1}function sN(e,t={}){let n=Array.isArray(e?.sourceIds)?e.sourceIds:[];return n.length?Math.max(...n.map(s=>nN(s,t))):1}function at(e,t={}){return(Array.isArray(e)?e:[]).map((s,o)=>({row:s,index:o,bias:sN(s,t)})).sort((s,o)=>o.bias-s.bias||(o.row?.trust??0)-(s.row?.trust??0)||s.index-o.index).map(s=>s.row)}var tN,mv=M(()=>{tN=/^src:corpus:(.+)$/});var jt,JG,Fr,QG,ZG,eV,tV,nV,sV,oV,rV,iV,aV,cV,lV,hv,oN,uV,dV,fV,Wo=M(()=>{jt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},JG=jt("createRequire"),Fr=jt("readFileSync"),QG=jt("access"),ZG=jt("readFile"),eV=jt("writeFile"),tV=jt("appendFile"),nV=jt("mkdir"),sV=jt("mkdtemp"),oV=jt("rename"),rV=jt("unlink"),iV=jt("rm"),aV=jt("stat"),cV=jt("copyFile"),lV=jt("readdir"),hv=jt("createReadStream"),oN=jt("createWriteStream"),uV=jt("randomBytes"),dV=jt("spawnSync"),fV=jt("createInterface")});function dp(e,t){let n=String(e).toLowerCase().replace(/^[^a-z]+/,"");if(!n)return null;for(let o of t.vowel_sound_consonants||[])if(n.startsWith(o))return!0;for(let o of t.consonant_sound_vowels||[])if(n.startsWith(o))return!1;let s=n[0];return"aeiou".includes(s)?!0:/[a-z]/.test(s)?!1:null}function cN(e=iN){let t=Fo(Fr(e,"utf8"));return Array.isArray(t.rule)?t.rule:[]}function Zc(){if(Qc===null)try{Qc=cN()}catch{Qc=[]}return Qc}var lN,rN,iN,aN,yV,Qc,el=M(()=>{Wo();co();Je();Tc();Jc();lN={},rN=ye(qt(lN.url)),iN=ne(rN,"..","..","data","templates","grammar-rules.toml"),aN=Object.freeze(["prose","entity","path","number","code","provenance","receipt"]),yV=Object.freeze(new Set(aN.filter(e=>e!=="prose")));Qc=null});function uN(){if(Ki!==void 0)return Ki;try{let e=gv?gv():dN();Ki=e&&e.winkNLP&&e.model?e:null}catch{Ki=null}return Ki}function dN(){let e=process.getBuiltinModule("node:module").createRequire(fN.url);return{winkNLP:e("wink-nlp"),model:e("wink-eng-lite-web-model")}}function tl(){if(Dr!==void 0)return Dr;let e=uN();if(!e)return Dr=null,null;try{Dr=e.winkNLP(e.model)}catch{Dr=null}return Dr}var fN,gv,Ki,Dr,nl=M(()=>{fN={}});var fp=M(()=>{nl()});var wv,bv=M(()=>{wv={comment:"tmct's starter lexicon, now covering BOTH the original software domain and the default 'human-world' persona's everyday people/places/objects/nature/time/body/mind vocabulary. Every word the ACE-OWL sub-fragment parser (src/domain/grammar/ace.mjs) is allowed to understand is DECLARED here \u2014 tmct never guesses a word's category. Nouns may declare a possessive property typing ('data' or 'object', pattern 7) or an irregular 'plural' (WordNet-sourced human nouns like 'man'/'child' need this \u2014 the morphology fold only handles regular -s/-ies/-es endings); adjectives MUST declare a type ('subclass' forms a class, 'data' asserts a boolean-ish datatype property, pattern 8); verbs may declare a preposition ('depend' + 'on' \u2192 dependsOn). The human-domain additions are flat and simple (breadth over depth \u2014 no gender/kinship taxonomy, no formal role hierarchy), matching corpus/tier2/generate.mjs's CORPUSES.human.lexicon sub-key, which --verify drift-checks against. Extend via loadLexicon(extra) with this same shape.",nouns:{module:{},class:{},function:{},method:{},attribute:{},variable:{},constant:{},test:{},suite:{},service:{},repository:{},branch:{},commit:{},tag:{},release:{},package:{},library:{},framework:{},api:{},endpoint:{},route:{},handler:{},controller:{},model:{},view:{},template:{},component:{},interface:{},type:{},category:{},kind:{},artifact:{},routine:{},part:{},helper:{},operation:{},change:{},schema:{},database:{},table:{},query:{},index:{plural:"indices"},cache:{},queue:{},worker:{},job:{},task:{},bug:{},defect:{},issue:{},ticket:{},feature:{},requirement:{},specification:{},document:{},developer:{},engineer:{},user:{},visitor:{},team:{},project:{},codebase:{},file:{},directory:{},folder:{},line:{},symbol:{},identifier:{},comment:{},docstring:{},string:{},number:{},list:{},array:{},graph:{},node:{},edge:{},triple:{},fact:{},ontology:{},lexicon:{},grammar:{},sentence:{},utterance:{},session:{},response:{},request:{},question:{},answer:{},error:{},exception:{},warning:{},log:{},metric:{},benchmark:{},pipeline:{},build:{},deployment:{},environment:{},config:{},configuration:{},setting:{},option:{},flag:{},argument:{},parameter:{},value:{},result:{},output:{},input:{},server:{},client:{},protocol:{},message:{},event:{},hook:{},plugin:{},script:{},tool:{},command:{},prompt:{},token:{},parser:{},compiler:{},linter:{},formatter:{},runtime:{},process:{},thread:{},loop:{},statement:{},expression:{},keyword:{},scope:{},callback:{},promise:{},iterator:{},generator:{},unit:{},risk:{},prototype:{},milestone:{},sprint:{},backlog:{},roadmap:{},phase:{},pattern:{},smell:{},coverage:{},mock:{},stub:{},fixture:{},assertion:{},snapshot:{},regression:{},migration:{},refactor:{},review:{},merge:{},license:{property:"data"},version:{property:"data"},name:{property:"data"},path:{property:"data"},size:{property:"data"},status:{property:"data"},language:{property:"data"},extension:{property:"data"},churn:{property:"data"},impact:{property:"data"},complexity:{property:"data"},latency:{property:"data"},duration:{property:"data"},frequency:{property:"data"},severity:{property:"data"},owner:{property:"object"},maintainer:{property:"object"},author:{property:"object"},reviewer:{property:"object"},parent:{property:"object"},dependency:{property:"object"},man:{plural:"men"},woman:{plural:"women"},person:{plural:"people"},child:{plural:"children"},boy:{},girl:{},baby:{},adult:{},friend:{},neighbor:{},stranger:{},guest:{},doctor:{},teacher:{},nurse:{},student:{},farmer:{},mother:{},father:{},brother:{},sister:{},family:{},king:{},queen:{},soldier:{},artist:{},writer:{},cook:{},group:{},crowd:{},audience:{},club:{},president:{},human:{},lawyer:{},driver:{},manager:{},officer:{},judge:{},priest:{},servant:{},butler:{},housekeeper:{},gardener:{},employee:{},boss:{},husband:{},wife:{plural:"wives"},son:{},daughter:{},grandmother:{},grandfather:{},citizen:{},customer:{},leader:{},champion:{},volunteer:{},resident:{},place:{},city:{},town:{},village:{},country:{},house:{},home:{},room:{},kitchen:{},bedroom:{},bathroom:{},school:{},hospital:{},shop:{},market:{},church:{},park:{},garden:{},street:{},road:{},bridge:{},farm:{},office:{},factory:{},museum:{},hotel:{},airport:{},castle:{},beach:{},forest:{},mountain:{},hat:{},shirt:{},coat:{},shoe:{},dress:{},clothing:{},chair:{},desk:{},lamp:{},portrait:{},bed:{},door:{},window:{},wall:{},roof:{},pen:{},paper:{},key:{},lock:{},box:{},car:{},bicycle:{},boat:{},train:{},wheel:{},knife:{plural:"knives"},spoon:{},fork:{},plate:{},cup:{},bottle:{},bag:{},money:{},coin:{},toy:{},machine:{},clock:{},phone:{},book:{},letter:{},umbrella:{},glove:{},sock:{},ring:{},watch:{},mirror:{},candle:{},ladder:{},hammer:{},basket:{},wallet:{},dog:{},cat:{},horse:{},cow:{},pig:{},sheep:{},bird:{},fish:{},mouse:{plural:"mice"},rabbit:{},rodent:{},bear:{},lion:{},tiger:{},elephant:{},snake:{},mole:{},groundhog:{},meerkat:{},tree:{},flower:{},grass:{},leaf:{plural:"leaves"},root:{},seed:{},fruit:{},water:{},air:{},fire:{},earth:{},stone:{},sand:{},gold:{},iron:{},rain:{},snow:{},wind:{},cloud:{},sun:{},moon:{},star:{},owl:{},wolf:{plural:"wolves"},frog:{},bee:{},ant:{},butterfly:{},spider:{},river:{},ocean:{},time:{},day:{},night:{},morning:{},evening:{},week:{},month:{},year:{},hour:{},minute:{},second:{},moment:{},season:{},spring:{},summer:{},winter:{},wedding:{},race:{},dozen:{},half:{plural:"halves"},amount:{},meeting:{},game:{},war:{},trip:{},birthday:{},holiday:{},autumn:{},century:{},body:{},head:{},hand:{},arm:{},leg:{},foot:{plural:"feet"},eye:{},ear:{},mouth:{},nose:{},hair:{},heart:{},blood:{},bone:{},skin:{},face:{},food:{},bread:{},meat:{},milk:{},egg:{},cheese:{},vegetable:{},meal:{},breakfast:{},dinner:{},drink:{},wine:{},tea:{},coffee:{},tongue:{},tooth:{plural:"teeth"},finger:{},toe:{},shoulder:{},knee:{},brain:{},lung:{},sugar:{},salt:{},word:{},story:{},news:{},idea:{},thought:{},mind:{},memory:{},dream:{},belief:{},love:{},hate:{},fear:{},joy:{},anger:{},hope:{},surprise:{},pride:{},song:{},music:{},sound:{},voice:{},picture:{},art:{},knowledge:{},opinion:{},reason:{},imagination:{},laughter:{},tear:{},smile:{},silence:{},object:{},location:{},quantity:{},organization:{},animal:{},plant:{},furniture:{},vehicle:{},insect:{},emotion:{},metal:{},liquid:{},weather:{},planet:{},jewelry:{},cutlery:{},government:{},material:{},draw:{},set:{},heavy:{},stand:{},free:{},pack:{},dead:{},pick:{},double:{},straight:{},cast:{},dry:{},bank:{},stamp:{},tender:{},fair:{},active:{},regular:{},blue:{},hack:{},band:{},brush:{},guard:{},master:{},transfer:{},firm:{},side:{},bull:{},mate:{},rank:{},board:{},brace:{},grade:{},better:{},course:{},natural:{},butt:{},camp:{},crop:{},date:{},fold:{},help:{},hunt:{},count:{},court:{},crush:{},major:{},march:{},tease:{},tough:{},flight:{},forward:{},division:{},commission:{},jam:{},rat:{},gray:{},hood:{},jerk:{},miss:{},pile:{},pool:{},rear:{},whip:{},bench:{},chain:{},cycle:{},grind:{},guide:{},stiff:{},troll:{},union:{},circle:{},carrier:{},defence:{},defense:{},radical:{},reserve:{},intimate:{},opposite:{},superior:{},grey:{},host:{},knot:{},left:{},lost:{},blind:{},crank:{},panel:{},rally:{},state:{},tramp:{},waver:{},clutch:{},living:{},runner:{},steady:{},stream:{},combine:{},company:{},convert:{},general:{},moderate:{},alternate:{},ace:{},crab:{},flop:{},fund:{},pair:{},rake:{},rock:{},sick:{},blade:{},cheat:{},sport:{},caller:{},column:{},couple:{},divine:{},pledge:{},simple:{},sponge:{},system:{},wanton:{},sleeper:{},business:{},associate:{},instrument:{},substitute:{},gun:{},sum:{},alto:{},best:{},buff:{},dear:{},mass:{},cream:{},creep:{},giant:{},labor:{},pilot:{},sneak:{},stack:{},staff:{},world:{},gutter:{},jumper:{},labour:{},lather:{},picket:{},reader:{},savage:{},captain:{},culture:{},monitor:{},neutral:{},unknown:{},utility:{},inferior:{},initiate:{},innocent:{},national:{},transpose:{},association:{},professional:{},bum:{},fan:{},law:{},deck:{},fool:{},join:{},kink:{},page:{},pink:{},stud:{},twin:{},clump:{},coach:{},dance:{},drone:{},extra:{},feast:{},fence:{},fleet:{},flock:{},ghost:{},clear:{},right:{},open:{},beat:{},back:{},block:{},see:{},keep:{},square:{},pitch:{},center:{},centre:{},top:{},post:{},field:{},spot:{},bar:{},end:{},frame:{},rough:{},address:{},quarter:{},position:{},land:{},bound:{},range:{},seat:{},dark:{},rail:{},cross:{},section:{},tip:{},plug:{},port:{},stall:{},corner:{},outside:{},dig:{},way:{},front:{},joint:{},patch:{},reach:{},thick:{},medium:{plural:"media"},dock:{},ruin:{},tack:{},floor:{},bottom:{},puddle:{},compound:{},retreat:{},mat:{},belt:{},dump:{},scene:{},space:{},border:{},common:{},cradle:{},inside:{},surface:{},lie:{},boot:{},clog:{},coil:{},nest:{},wire:{},yard:{},forge:{},limit:{},lodge:{},buffer:{},middle:{},capital:{},overhead:{},preserve:{},terminal:{},direction:{},hall:{},loft:{},plot:{},tape:{},grate:{},stoop:{},fringe:{},circuit:{},distance:{},derivation:{},bent:{},gate:{},mill:{},safe:{},sail:{},hedge:{},paint:{},parcel:{},sphere:{},bearing:{},profile:{},shelter:{},crossing:{},interior:{},reservation:{},area:{},bush:{},cork:{},dive:{},limb:{},raft:{},shed:{},zone:{},chase:{},cut:{},light:{},charge:{},check:{},work:{},stock:{},stick:{},flat:{},crack:{},press:{},settle:{},spread:{},wash:{},well:{},swing:{},fly:{},tap:{},stretch:{},shot:{},black:{},strip:{},separate:{},tie:{},rack:{},match:{},piece:{},shell:{},still:{},present:{},trim:{},spike:{},split:{},white:{},yield:{},squeeze:{},bolt:{},fret:{},choke:{},float:{},track:{},low:{},crown:{},screen:{},die:{plural:"dice"},pin:{},chip:{},mold:{},seal:{},draft:{},shade:{},shaft:{},stuff:{},switch:{},balance:{},reverse:{},subject:{},approach:{},beam:{},bill:{},card:{},link:{},sack:{},sink:{},trap:{},spare:{},credit:{},counter:{},express:{},positive:{},net:{},pay:{},ball:{},bond:{},bowl:{},horn:{},pole:{},wing:{},glass:{},grant:{},smack:{},collar:{},record:{},ruffle:{},silver:{},negative:{},cap:{},lap:{},pad:{},rag:{},rig:{},bend:{},clip:{},fine:{},flap:{},heel:{},pall:{},pump:{},gauge:{},image:{},plain:{},print:{},slick:{},spoil:{},clinch:{},gather:{},offset:{},pocket:{},relief:{},channel:{},whistle:{},irregular:{},transport:{},bat:{},ice:{},peg:{},pot:{},bust:{},grip:{},hole:{},nail:{},poke:{},slug:{},spat:{},stem:{},suit:{},yoke:{},flood:{},grand:{},gross:{},perch:{},slip:{},down:{},shoot:{},ground:{},discharge:{},solid:{},kill:{},slack:{},waste:{},rush:{},grain:{},shake:{},pit:{},mould:{},colour:{},render:{},mount:{},cutting:{},fill:{},flux:{},tail:{},plaster:{},swallow:{},concentrate:{},bay:{},gum:{},ray:{},slop:{},spur:{},extract:{},fat:{},hop:{},corn:{},rust:{},smut:{},label:{},stain:{},composition:{},gas:{},pip:{},duck:{},gall:{},lime:{},mint:{},tick:{},stalk:{},whiff:{},cement:{},rubber:{},conjugate:{},preparation:{},dun:{},dust:{},jade:{},mire:{},pulp:{},snag:{},bloom:{},caper:{},crude:{},fluid:{},frost:{},paste:{},rinse:{},steam:{},straw:{},corona:{},poison:{},refuse:{},savory:{},feather:{},ferment:{},organic:{},chestnut:{},mushroom:{},percolate:{},sublimate:{},synthetic:{},suspension:{},precipitate:{},cod:{},pet:{},rod:{},bunt:{},crow:{},hide:{},punk:{},vein:{},assay:{},goose:{plural:"geese"},olive:{},stray:{},trash:{},ginger:{},pepper:{},permit:{},polish:{},sorrel:{},blister:{},bristle:{},complex:{},filling:{},flicker:{},harvest:{},scollop:{},whiting:{},anteater:{},snowball:{},tincture:{},repellent:{},ink:{},lip:{},nag:{},rue:{},wad:{},acid:{},beak:{},bean:{},coal:{},dirt:{},fawn:{},fuel:{},lark:{},ling:{},mash:{},palm:{},pelt:{},plum:{},pony:{},pout:{},soil:{},stag:{},bream:{},brier:{},chalk:{},coral:{},fiber:{},fall:{},pass:{},lift:{},go:{},roll:{},drop:{},blow:{},return:{},strike:{},rise:{},snap:{},shift:{},twist:{},case:{},deal:{},start:{},deep:{},jump:{},step:{},stop:{},pound:{},advance:{},pop:{},flash:{},rest:{},crash:{},score:{},figure:{},leave:{},smash:{},stroke:{},first:{},sweep:{},even:{},flow:{},kick:{},heave:{},trace:{},opening:{},full:{},gain:{},jack:{},spin:{},wave:{},splash:{},bob:{},bang:{},dash:{},flick:{},hitch:{},prime:{},proof:{},passing:{},bit:{},click:{},knock:{},swell:{},trouble:{},collapse:{},movement:{},standard:{},variation:{},rap:{},boom:{},bump:{},clap:{},pace:{},peck:{},zero:{},blaze:{},speed:{},spell:{},treat:{},bounce:{},factor:{},little:{},plunge:{},scrape:{},single:{},ban:{},mix:{},one:{},mesh:{},roar:{},tilt:{},climb:{},flip:{},puff:{},bite:{},feed:{},bitter:{},chop:{},sour:{},special:{},crisp:{},tonic:{},scallop:{},mess:{},quick:{},smear:{},fillet:{},curl:{},malt:{},glaze:{},souse:{},breast:{},humour:{},draught:{},delicacy:{},dressing:{},transplant:{},hip:{},sop:{},kiss:{},mush:{},neck:{},belly:{},frank:{},jumble:{},junket:{},trifle:{},stomach:{},clot:{},shin:{},stew:{},tart:{},cheek:{},graft:{},molar:{},roast:{},spice:{},stout:{},sweat:{},groove:{},region:{},savoury:{},western:{},backbone:{},conserve:{},dominant:{},macerate:{},melancholy:{},cake:{},lens:{},loaf:{plural:"loaves"},menu:{},must:{},peel:{},pore:{},suds:{},butch:{},cling:{},curry:{},drool:{},honey:{},jerky:{},juice:{},mince:{},nasal:{},nerve:{},sauce:{},tract:{},dainty:{},entree:{},facial:{},relish:{},squash:{},brittle:{},caramel:{},cordial:{},fissure:{},oblique:{},adhesion:{},turnover:{},nonpareil:{},posterior:{},vegetation:{},ail:{},orb:{},pap:{},rum:{},brew:{},chew:{},hash:{},lard:{},rump:{},brine:{},dowdy:{},farce:{},flour:{},fudge:{},halal:{},icing:{},lunch:{},play:{},make:{},hold:{},close:{},mark:{},form:{},order:{},support:{},rule:{},sign:{},hang:{},drag:{},feel:{},find:{},shock:{},mean:{},offer:{},study:{},show:{},tone:{},flare:{},attack:{},act:{},life:{plural:"lives"},stay:{},think:{},secret:{},account:{},hurt:{},note:{},taste:{},report:{},measure:{},condition:{},cry:{},focus:{plural:"foci"},style:{},thing:{},title:{},recall:{},average:{},contract:{},dissolve:{},so:{},aim:{},bind:{},heat:{},know:{},stir:{},claim:{},power:{},demand:{},design:{},notice:{},source:{},upgrade:{},resolution:{},bid:{},skim:{},brand:{},curve:{},sight:{},smoke:{},digest:{},regard:{},passage:{},program:{},exposure:{},interest:{},character:{},projection:{},lay:{},curse:{},favor:{},remit:{},sense:{},slash:{},wedge:{},bubble:{},excuse:{},favour:{},invite:{},mantle:{},salute:{},stress:{},survey:{},temper:{},comfort:{},neglect:{},resolve:{},respect:{},torment:{},conflict:{},dispatch:{},standing:{},challenge:{},programme:{},background:{},conclusion:{},impression:{},particular:{},withdrawal:{},cite:{},echo:{},hail:{},rip:{},lot:{},great:{},relay:{},tenor:{},browse:{},bundle:{},chorus:{},cypher:{},fellow:{},litter:{},marine:{},native:{},occult:{},plague:{},rocker:{},scheme:{},series:{plural:"series"},social:{},streak:{},sucker:{},teaser:{},antique:{},battery:{},bracket:{},founder:{},gallery:{},liberal:{},starter:{},turnout:{},witness:{},diagonal:{},familiar:{},ordinary:{},prospect:{},sequence:{},aggregate:{},authority:{},community:{},dependent:{},desperate:{},patronage:{},primitive:{},principal:{},complement:{},engagement:{},foundation:{},generation:{},settlement:{},combination:{},lightweight:{},steamroller:{},subordinate:{},organisation:{},establishment:{},representative:{},con:{},fox:{},kid:{},pod:{},red:{},sex:{},spy:{},vet:{},aged:{},bore:{},diet:{},fare:{},gown:{},hawk:{},heap:{},herd:{},hive:{},lump:{},romp:{},sort:{},agent:{},alien:{},beard:{},brave:{},breed:{},brood:{},canon:{},craft:{},crazy:{},devil:{},dummy:{},equal:{},flake:{},groom:{},mound:{},organ:{},scrub:{},toast:{},troop:{},youth:{},colony:{},copper:{},cutter:{},escort:{},feeder:{},junior:{},maroon:{},matrix:{plural:"matrices"},modern:{},muscle:{},people:{},sector:{},shrink:{},tinker:{},topper:{},booster:{},gallant:{},hostile:{},marshal:{},network:{},nucleus:{plural:"nuclei"},premier:{},scourge:{},secular:{},sitting:{},snapper:{},suspect:{},swagger:{},traffic:{},variant:{},cardinal:{},derelict:{},domestic:{},favorite:{},finisher:{},graduate:{},humanist:{},infernal:{},magazine:{},manifold:{},minister:{},palatine:{},presence:{},receiver:{},relation:{},favourite:{},following:{},goldbrick:{},operative:{},sensitive:{},syndicate:{},complexion:{},mouthpiece:{},withdrawer:{},appointment:{},conjugation:{},constituent:{},heavyweight:{},incompetent:{},independent:{},replacement:{},underground:{},untouchable:{},conservative:{},administration:{},ape:{},gem:{},hob:{},sap:{},van:{},axis:{plural:"axes"},chap:{},char:{},crew:{},cult:{},duet:{},gang:{},hero:{},hire:{},lamb:{},lame:{},mute:{},nude:{},pawn:{},pill:{},sage:{},soul:{},tout:{},trio:{},ward:{},worm:{},bunch:{},crimp:{},dwarf:{},elect:{},flank:{},ideal:{},noble:{},octet:{},quack:{},saint:{},scrag:{},shark:{},shoal:{},silly:{},skunk:{},super:{},witch:{},zombi:{},agency:{},anchor:{},backup:{},batter:{},buster:{},canary:{},circus:{},dealer:{},domain:{},doomed:{},genius:{},gossip:{},herald:{},hoodoo:{},hopper:{},immune:{},jockey:{},legion:{},member:{},nature:{},orphan:{},parade:{},peanut:{},pillar:{},pirate:{},player:{},porter:{},pusher:{},putter:{},senior:{},septet:{},sestet:{},sextet:{},surety:{},tapper:{},tiller:{},zombie:{},adjunct:{},butcher:{},captive:{},cascade:{},chapter:{},charity:{},checker:{},chicane:{},chicken:{},climber:{},cognate:{},consort:{},cracker:{},dresser:{},gentile:{},invalid:{},knocker:{},lineage:{},mission:{},mixture:{},monster:{},offence:{},partner:{},pioneer:{},pitcher:{},quartet:{},quintet:{},recruit:{},referee:{},shooter:{},spoiler:{},sponsor:{},stemmer:{},steward:{},striker:{},terrace:{},alliance:{},castrate:{},designer:{},director:{},ensemble:{},faithful:{},friendly:{},mandarin:{},operator:{},romantic:{},accessory:{},annoyance:{},attendant:{},bourgeois:{},precedent:{},quadruple:{},reception:{},recession:{},religious:{},reprobate:{},satellite:{},selection:{},sensation:{},supporter:{},contingent:{},convention:{},expedition:{},incendiary:{},individual:{},masquerade:{},population:{},sweetheart:{},tubercular:{},confederate:{},cooperative:{},subdivision:{},territorial:{},transcriber:{},intelligence:{},registration:{},sophisticate:{},welterweight:{},revolutionary:{},ex:{},ass:{},cog:{},cub:{},den:{},dud:{},duo:{},ham:{},hog:{},mob:{},pro:{},deaf:{},dove:{},fate:{},five:{},folk:{},gull:{},jinx:{},mime:{},nark:{},nine:{},pest:{},prey:{},quad:{},rash:{},scab:{},sire:{},wisp:{},wood:{},zany:{},armor:{},batch:{},bogey:{},caste:{},chief:{},choir:{},clone:{},divan:{},drunk:{},elder:{},enemy:{},exile:{},faith:{},flirt:{},grunt:{},joker:{},lobby:{},louse:{plural:"lice"},pagan:{},pivot:{},racer:{},rebel:{},scout:{},siren:{},slave:{},swarm:{},timid:{},triad:{},tribe:{},armour:{},bearer:{},censor:{},choker:{},convoy:{},covert:{},damned:{},deputy:{},empire:{},goffer:{},gopher:{},huddle:{},killer:{},league:{},martyr:{},muster:{},mystic:{},outfit:{},packet:{},palace:{},passer:{},patrol:{},potter:{},quarry:{},rigger:{},ringer:{},rustic:{},scribe:{},sitter:{},slider:{},slouch:{},squire:{},squirt:{},stupid:{},summit:{},tailor:{},tenant:{},terror:{},tracer:{},turkey:{},turner:{},venter:{},voider:{},voodoo:{},walker:{},worthy:{},academy:{},agonist:{},amateur:{},ancient:{},banquet:{},cabinet:{},cashier:{},classic:{},commune:{},courser:{},crammer:{},current:{},divider:{},economy:{},edition:{},emperor:{},entrant:{},fireman:{},lookout:{},octette:{},orderly:{},painter:{},pervert:{},plotter:{},plunger:{},roaster:{},sampler:{},scanner:{},sellout:{},skimmer:{},skipper:{},society:{},soprano:{},spastic:{},spotter:{},stratum:{plural:"strata"},trimmer:{},tripper:{},trooper:{},tumbler:{},upstart:{},veteran:{},wheeler:{},academic:{},agnostic:{},aviation:{},backstop:{},baritone:{},calendar:{},casualty:{},colonial:{},divinity:{},fireball:{},homeless:{},huckster:{},marriage:{},militant:{},military:{},ministry:{},modifier:{},partisan:{},pedigree:{},possible:{},recorder:{},regiment:{},renegade:{},repeater:{},revenant:{},septette:{},sextette:{},shepherd:{},stalwart:{},stringer:{},stripper:{},whistler:{},affiliate:{},ascendant:{},bacchanal:{},canvasser:{},cockscomb:{},collector:{},comforter:{},commander:{},companion:{},conductor:{},crossover:{},eccentric:{},executive:{},fledgling:{},franchise:{},freelance:{},incumbent:{},mercenary:{},moderator:{},neighbour:{},newspaper:{},patriarch:{},patrician:{},portfolio:{},quartette:{},quintette:{},repertory:{},secretary:{},segregate:{},spearhead:{},stigmatic:{},summation:{},transient:{},trumpeter:{},voluntary:{},absolutism:{},anthropoid:{},apparition:{},assemblage:{},collective:{},contractor:{},delinquent:{},episcopate:{},exaltation:{},exposition:{},illiterate:{},judicature:{},leadership:{},lieutenant:{},minimalist:{},percussion:{},profligate:{},provincial:{},rendezvous:{},brotherhood:{},determinant:{},distributor:{},interpreter:{},stipendiary:{},analphabetic:{},antediluvian:{},civilisation:{},civilization:{},commonwealth:{},conglomerate:{},contemporary:{},cosmopolitan:{},humanitarian:{},neighborhood:{},thoroughbred:{},ultramontane:{},concatenation:{},featherweight:{},superordinate:{},classification:{},fundamentalist:{},cop:{},don:{},eon:{},gal:{},gob:{},god:{},hoe:{},kin:{},nan:{},pup:{},wag:{},wit:{},aeon:{},ally:{},bard:{},chum:{},clew:{},dean:{},fink:{},flak:{},geek:{},goof:{},hulk:{},idol:{},lady:{},loon:{},mace:{},para:{},ruck:{},seer:{},self:{plural:"selves"},adder:{},angel:{},augur:{},baron:{},blond:{},brick:{},brute:{},cabal:{},champ:{},comic:{},crier:{},decoy:{},demon:{},diner:{},diver:{},diwan:{},drove:{},envoy:{},fiend:{},flack:{},flier:{},flyer:{},freak:{},gaudy:{},harpy:{},horde:{},indie:{},jewel:{},leech:{},levee:{},liege:{},locus:{},loser:{},mimic:{},needy:{},nymph:{},oiler:{},poser:{},pupil:{},riser:{},roper:{},rummy:{},scold:{},squad:{},timer:{},tutor:{},usher:{},vicar:{},whale:{},wiper:{},affine:{},albino:{},angler:{},badass:{},baster:{},beggar:{},blonde:{},bomber:{},bowler:{},butter:{},carver:{},caster:{},chichi:{},clinic:{},closer:{},cohort:{},coiner:{},comber:{},cookie:{},cordon:{},corpus:{},cotter:{},cowboy:{},coyote:{},critic:{},dragon:{},drawer:{},drudge:{},eleven:{},ensign:{},estate:{},ethnic:{},exarch:{},finder:{},fodder:{},gaffer:{},gainer:{},galaxy:{},granny:{},hacker:{},hedger:{},heller:{},holder:{},honker:{},hooker:{},hotdog:{},inmate:{},intern:{},jungle:{},knight:{},kvetch:{},lineup:{},lovely:{},magpie:{},maiden:{},mailer:{},maniac:{},matron:{},miller:{},muller:{},nation:{},opener:{},ouster:{},packer:{},parrot:{},patron:{},peeler:{},peeper:{},polity:{},poster:{},powwow:{},punter:{},puppet:{},purdah:{},racist:{},rafter:{},ramrod:{},redact:{},regent:{},rusher:{},sailor:{},scorer:{},seeder:{},shaver:{},slaver:{},slicer:{},smoker:{},snitch:{},syntax:{},tacker:{},tagger:{},tanker:{},tartar:{},teller:{},thrush:{},trigon:{},troika:{},truant:{},tucker:{},tyrant:{},umpire:{},undoer:{},vestal:{},virgin:{},votary:{},warren:{},washer:{},wetter:{},winder:{},winner:{},wizard:{},admirer:{},amnesic:{},analyst:{},anomaly:{},aphasic:{},armorer:{},arrival:{},ascetic:{},auditor:{},baggage:{},bastion:{},biology:{},boarder:{},brahman:{},brahmin:{},breaker:{},caravan:{},clapper:{},cluster:{},coaster:{},cobbler:{},college:{},convict:{},council:{},counsel:{},coxcomb:{},crawler:{},creeper:{},crewman:{},crimper:{},darling:{},destiny:{},dragoon:{},dreamer:{},duality:{},echelon:{},ejector:{},fiddler:{},fighter:{},flasher:{},forbear:{},harrier:{},holdout:{},hostess:{},incubus:{},ingenue:{},justice:{},kachina:{},kindred:{},kingpin:{},macumba:{},manikin:{},marcher:{},married:{},newborn:{},notable:{},nursing:{},outpost:{},parvenu:{},patient:{},payroll:{},peasant:{},phalanx:{},phantom:{},planter:{},platoon:{},plodder:{},poacher:{},printer:{},prodigy:{},puncher:{},realist:{},redhead:{},revival:{},runaway:{},scholar:{},sharpie:{},skidder:{},slicker:{},slogger:{},smasher:{},snorter:{},snuffer:{},spinner:{},splicer:{},stalker:{},stamper:{},standby:{},stepper:{},striper:{},sweeper:{},thrower:{},triplet:{},utopian:{},utterer:{},voucher:{},washout:{},watcher:{},wiggler:{},wrecker:{},affluent:{},armourer:{},attender:{},bacchant:{},bachelor:{},bankrupt:{},bisexual:{},bondsman:{},cautious:{},congress:{},corporal:{},creature:{},decadent:{},defeated:{},delegate:{},diabetic:{},dictator:{},dyslexic:{},effector:{},exponent:{},flagging:{},freshman:{},fugitive:{},futurist:{},garrison:{},greyback:{},hangover:{},humanism:{},immortal:{},juvenile:{},lapidary:{},mainstay:{},mannikin:{},maverick:{},mechanic:{},minority:{},minstrel:{},mistress:{},monotype:{},mutation:{},nativist:{},neophyte:{},neurotic:{},newsroom:{},nobility:{},opponent:{},pacifier:{},pantheon:{},planting:{},probable:{},producer:{},recusant:{},referral:{},reminder:{},retainer:{},ruralism:{},scalawag:{},scrubber:{},searcher:{},sergeant:{},sociable:{},songster:{},splitter:{},squadron:{},straggle:{},strawman:{},survivor:{},taxonomy:{},treasury:{},vanguard:{},virtuoso:{},walloper:{},warhorse:{},yearling:{},alcoholic:{},anorectic:{},artificer:{},artillery:{},attracter:{},attractor:{},automaton:{},auxiliary:{},barbarian:{},bombshell:{},brokerage:{},coalition:{},concourse:{},contralto:{},counselor:{},crewwoman:{},cyberpunk:{},defaulter:{},deliverer:{},democracy:{},dependant:{},descender:{},dissident:{},dyspeptic:{},feudatory:{},firewoman:{},flyweight:{},incurable:{},institute:{},insurgent:{},intellect:{},introvert:{},mandatory:{},mendicant:{},middleman:{},navigator:{},organiser:{},organizer:{},pluralism:{},pluralist:{},pothunter:{},precursor:{},predictor:{},presenter:{},pretender:{},processor:{},proconsul:{},publisher:{},quintuple:{},registrar:{},regulator:{},scallywag:{},scavenger:{},scrambler:{},scratcher:{},serration:{},singleton:{},stargazer:{},stockpile:{},successor:{},surrogate:{},symbolism:{},temporary:{},throwback:{},trickster:{},warrantee:{},womanhood:{},antagonist:{},attendance:{},blackguard:{},bondswoman:{},chancellor:{},classifier:{},conference:{},conformist:{},counsellor:{},crossroads:{},descendant:{},descendent:{},doorkeeper:{},embodiment:{},expatriate:{},federation:{},fellowship:{},filibuster:{},forerunner:{},fratricide:{},grandstand:{},mastermind:{},minstrelsy:{},missionary:{},ordination:{},plantation:{},powerhouse:{},quadruplet:{},quintuplet:{},repatriate:{},republican:{},respondent:{},rubberneck:{},salamander:{},scholastic:{},separatism:{},sisterhood:{},subscriber:{},subsidiary:{},supplicant:{},suppresser:{},suppressor:{},timekeeper:{},translator:{},university:{},wallflower:{},abomination:{},academician:{},agriculture:{},anachronism:{},antiquarian:{},beneficiary:{},bureaucracy:{},clairvoyant:{},conditioner:{},confederacy:{},consumptive:{},deification:{},enlightened:{},incarnation:{},lilliputian:{},middlewoman:{},narcoleptic:{},nationalist:{},partnership:{},peacekeeper:{},peripatetic:{},pontificate:{},progression:{},prosecution:{},quarterback:{},recessional:{},romanticist:{},shipbuilder:{},transmitter:{},transsexual:{},underwriter:{},undesirable:{},utilitarian:{},acquaintance:{},bantamweight:{},collaborator:{},congregation:{},conservatory:{},countertenor:{},demonstrator:{},denomination:{},headquarters:{},illegitimate:{},investigator:{},metropolitan:{},middleweight:{},noncombatant:{},philharmonic:{},schoolmaster:{},sharpshooter:{},totalitarian:{},authoritarian:{},confederation:{},correspondent:{},reincarnation:{},schizophrenic:{},supernumerary:{},categorization:{},tatterdemalion:{},instrumentality:{},internationalist:{},bey:{},cox:{},cur:{},few:{},foe:{},hag:{},lad:{},mod:{},obi:{},sib:{},aide:{},amah:{},anti:{},army:{},beau:{},bevy:{},bogy:{},chit:{},clod:{},coon:{},czar:{},dada:{},dame:{},derp:{},dodo:{},dude:{},duke:{},dupe:{},gild:{},giro:{},goat:{},goon:{},grad:{},guru:{},heir:{},hobo:{},hunk:{},jilt:{},jock:{},jury:{},khan:{},maid:{},naif:{},navy:{},nerd:{},peri:{},pimp:{},putz:{},sect:{},suer:{},swot:{},tuft:{},adept:{},baker:{},basso:{},beast:{},bride:{},bunny:{},cadre:{},comer:{},cooky:{},corps:{},covey:{},deist:{},edger:{},elite:{},emcee:{},enate:{},faery:{},fatty:{},fauna:{},felon:{},filer:{},flora:{},folks:{},forum:{},genus:{plural:"genera"},ghoul:{},gipsy:{},giver:{},gnome:{},grove:{},gypsy:{},hajji:{},hakim:{},junky:{},knave:{},lefty:{},leper:{},loony:{},macho:{},madam:{},magus:{},medic:{},mezzo:{},miler:{},mooch:{},mufti:{},nabob:{},nexus:{},ninja:{},obeah:{},parer:{},pigmy:{},poilu:{},ponce:{},prior:{},proxy:{},puppy:{},pygmy:{},quint:{},raver:{},rover:{},satyr:{},scamp:{},sheik:{},shill:{},shrew:{},sibyl:{},sissy:{},slain:{},smith:{},snoop:{},sprog:{},stoic:{},sylph:{},taker:{},thane:{},toady:{},totem:{},trier:{},tryst:{},tuner:{},twirp:{},uncle:{},valet:{},vegan:{},vixen:{},waker:{},widow:{},wight:{},wirer:{},yenta:{},agnate:{},alexic:{},amazon:{},audile:{},avatar:{},avower:{},bagger:{},bagman:{},banker:{},barber:{},barker:{},bather:{},bawler:{},beater:{},beldam:{},bidder:{},boater:{},brewer:{},broker:{},brunet:{},bureau:{},caddie:{},camper:{},cantor:{},caucus:{},chaser:{},cherub:{},chosen:{},coeval:{},cooper:{},coquet:{},cottar:{},craven:{},cubist:{},daemon:{},deacon:{},digger:{},dodger:{},dowser:{},duette:{},dunker:{},egoist:{},eldest:{},eparch:{},erotic:{},eyeful:{},faller:{},fitter:{},flunky:{},forger:{},framer:{},gaggle:{},gagman:{},gamine:{},gasbag:{},gillie:{},goalie:{},gouger:{},grouch:{},gunman:{},gunner:{},hamlet:{},hanger:{},hawker:{},heaver:{},hermit:{},hitter:{},hummer:{},iceman:{},joiner:{},junkie:{},jurist:{},keeper:{},kelpie:{},kisser:{},lackey:{},lector:{},lifter:{},lister:{},lizard:{},loader:{},loaner:{},logjam:{},longer:{},lubber:{},lumper:{},lyceum:{},madcap:{},maenad:{},maimed:{},masher:{},medico:{},menial:{},midden:{},midget:{},minder:{},moiety:{},motile:{},nester:{},oblate:{},oilman:{},parish:{},paster:{},pelter:{},phylum:{},picker:{},plenum:{},police:{},pruner:{},psyche:{},puller:{},python:{},rabble:{},raider:{},raiser:{},ranger:{},ranker:{},rapper:{},reaper:{},redcap:{},reeler:{},regime:{},renter:{},rifler:{},romper:{},sachem:{},salter:{},sawyer:{},sealer:{},seeker:{},sender:{},sexist:{},shaker:{},shaper:{},sharpy:{},signer:{},silvan:{},sleuth:{},smiler:{},sorter:{},sphinx:{},stager:{},stater:{},supper:{},sylvan:{},talent:{},tanner:{},tester:{},theist:{},throng:{},tilter:{},tipper:{},toller:{},tosser:{},tourer:{},townie:{},trusty:{},varlet:{},vermin:{},vestry:{},victor:{},virago:{},voicer:{},waster:{},weasel:{},weaver:{},weeder:{},weeper:{},weirdo:{},whaler:{},winker:{},wraith:{},wretch:{},yakuza:{},yeoman:{},adapter:{},admiral:{},airhead:{},amalgam:{},animist:{},aphakic:{},applier:{},arbiter:{},armiger:{},atheist:{},attache:{},babbler:{},baffled:{},beldame:{},beloved:{},berserk:{},bondman:{},bounder:{},brigade:{},browser:{},buffoon:{},bulimic:{},burgher:{},caitiff:{},carload:{},catcher:{},cavalry:{},chachka:{},changer:{},charmer:{},chemist:{},cocotte:{},collage:{},compere:{},shadow:{},layer:{},north:{},orbit:{},trend:{},truss:{},vault:{},bunker:{},harbor:{},orient:{},origin:{},resort:{},safety:{},target:{},chamber:{},extreme:{},harbour:{},kingdom:{},mandate:{},outline:{},station:{},blockade:{},darkness:{},overlook:{},landscape:{},northeast:{},northwest:{},partition:{},southeast:{},southwest:{},structure:{},atmosphere:{},lug:{},tee:{},balk:{},burr:{},cage:{},drip:{},east:{},fort:{},hoop:{},west:{},cleat:{},fluke:{},scour:{},south:{},beacon:{},closet:{},duplex:{},radius:{plural:"radii"},vacuum:{},wattle:{},canteen:{},grounds:{},cloister:{},pinnacle:{},property:{},surround:{},terminus:{},anchorage:{},barricade:{},honeycomb:{},turnaround:{},institution:{},termination:{},cab:{},dam:{},brim:{},calk:{},dome:{},goal:{},hill:{},hull:{},knob:{},prop:{},seam:{},site:{},turf:{},apron:{},arena:{},baulk:{},cabin:{},grill:{},groin:{},haunt:{},lever:{},niche:{},privy:{},works:{},airway:{},barren:{},corral:{},dugout:{},fender:{},galley:{},hurdle:{},lounge:{},outlet:{},refuge:{},sconce:{},sprawl:{},temple:{},toilet:{},wicket:{},barrack:{},bulwark:{},buttery:{},cornice:{},grating:{},landing:{},leeward:{},maximum:{},pasture:{},salient:{},shingle:{},squinch:{},surgery:{},building:{},cylinder:{},downtown:{},fountain:{},landmark:{},munition:{},quadrant:{},rearward:{},sideline:{},windward:{},homestead:{},multiplex:{},perfumery:{},residence:{},stretcher:{},substrate:{},excavation:{},silhouette:{},convenience:{},culmination:{},declination:{},architecture:{},spa:{},aery:{},brow:{},bung:{},dike:{},flue:{},hell:{},tent:{},abbey:{},aisle:{},arbor:{},attic:{},booth:{},brink:{},disco:{},oxbow:{},oxeye:{},quoin:{},realm:{},salon:{},villa:{},whorl:{},barony:{},barrow:{},bazaar:{},billet:{},bustle:{},canton:{},casing:{},cellar:{},cooler:{},garage:{},ghetto:{},grille:{},hearth:{},locker:{},midway:{},muffle:{},oracle:{},remise:{},saloon:{},stocks:{},studio:{},tiptop:{},uptown:{},volute:{},arsenal:{},chassis:{},cockpit:{},commons:{},cubicle:{},dockage:{},fairway:{},fencing:{},gondola:{},heading:{},hotspot:{},lattice:{},lodging:{},minimum:{},moorage:{},pannier:{},rattrap:{},rootage:{},stowage:{},theater:{},theatre:{},vacuity:{},baseline:{},butchery:{},buttress:{},clearing:{},crosscut:{},domicile:{},erection:{},exterior:{},fanlight:{},fastness:{},firewall:{},foothold:{},frontier:{},lavatory:{},memorial:{},monument:{},mortuary:{},overhang:{},pedestal:{},scenario:{},solitude:{},sprocket:{},stockade:{},stoppage:{},vaulting:{},bombproof:{},cathedral:{},fundament:{},hindrance:{},panhandle:{},proximity:{},resonator:{},sanctuary:{},territory:{},watershed:{},confluence:{},department:{},encampment:{},flashpoint:{},groundwork:{},hinderance:{},quartering:{},substratum:{},underbelly:{},breadbasket:{},columbarium:{},destination:{},engineering:{},equinoctial:{},planetarium:{},penitentiary:{},circumference:{},confectionery:{},fortification:{},hub:{},hut:{},lee:{},sty:{},acme:{},apex:{},barn:{},brig:{},coop:{},digs:{},holy:{},jail:{},jook:{},juke:{},loge:{},mall:{},nook:{},pave:{},sash:{},silo:{},slum:{},tope:{},weir:{},abode:{},aerie:{},altar:{},bazar:{},detox:{},haven:{},heath:{},hutch:{},kraal:{},lager:{},manor:{},manse:{},navel:{},oasis:{plural:"oases"},opera:{},paddy:{},plaza:{},pylon:{},rodeo:{},shire:{},spile:{},sprag:{},venue:{},visor:{},apogee:{},arcade:{},ashram:{},asylum:{},atrium:{},bagnio:{},bailey:{},barrio:{},belfry:{},boards:{},casino:{},chapel:{},county:{},creche:{},cupola:{},deckle:{},fraise:{},haymow:{},hostel:{},kennel:{},lancet:{},larder:{},lockup:{},mihrab:{},parlor:{},plaque:{},prefab:{},prison:{},spigot:{},stacks:{},tampon:{},turret:{},vertex:{},zodiac:{},automat:{},balcony:{},batwing:{},benthos:{},borough:{},bubbler:{},bullpen:{},cabaret:{},caboose:{},chantry:{},convent:{},deanery:{},demesne:{},derrick:{},desktop:{},drydock:{},dukedom:{},dungeon:{},earldom:{},earplug:{},embassy:{},emirate:{},eparchy:{},equinox:{},fiefdom:{},florist:{},flyover:{},framing:{},funfair:{},grocery:{},hayrack:{},hospice:{},khanate:{},lunette:{},mansion:{},marquee:{},masonry:{},matting:{},midland:{},mooring:{},narthex:{},nirvana:{},obelisk:{},outback:{},parapet:{},parlour:{},pinhead:{},railing:{},rathole:{},redoubt:{},ribbing:{},rotunda:{},sanctum:{},sawmill:{},shipway:{},shoebox:{},stopple:{},tambour:{},transom:{},trellis:{},trestle:{},tribune:{},vantage:{},abutment:{},airspace:{},ambiance:{},ambience:{},backside:{},ballpark:{},basement:{},basilica:{},bioscope:{},bodywork:{},brattice:{},diggings:{},doghouse:{},dominion:{},entrepot:{},environs:{},extremum:{},farmland:{},fireside:{},hacienda:{},hideaway:{},imperium:{},jalousie:{},littoral:{},mantelet:{},mounting:{},nailhead:{},outdoors:{},palisade:{},pharmacy:{},porthole:{},province:{},revolver:{},seascape:{},sidewall:{},steerage:{},stopover:{},suburbia:{},sudatory:{},sweatbox:{},tailgate:{},turnpike:{},wellhead:{},backwater:{},bailiwick:{},beachhead:{},belvedere:{},caliphate:{},caparison:{},cellarage:{},chandlery:{},cloakroom:{},colonnade:{},cookhouse:{},couchette:{},crematory:{},crownwork:{},cubbyhole:{},dollhouse:{},dormitory:{},dripstone:{},fieldwork:{},fireguard:{},forefront:{},guardroom:{},hatchback:{},isoclinal:{},lazaretto:{},lineation:{},mezzanine:{},millinery:{},orphanage:{},outfitter:{},pleasance:{},princedom:{},revetment:{},roadblock:{},scrapheap:{},shrubbery:{},viewpoint:{},viscounty:{},workhouse:{},architrave:{},birthplace:{},borderline:{},bridgehead:{},brownstone:{},chokepoint:{},commissary:{},courthouse:{},escarpment:{},greenhouse:{},ironmonger:{},justiciary:{},laboratory:{},lamination:{},maisonette:{},metropolis:{},obstructor:{},panopticon:{},playground:{},prefecture:{},proscenium:{},quadrangle:{},rotisserie:{},sanatorium:{},suzerainty:{},tenderloin:{},triclinium:{},wellspring:{},wheelhouse:{},condominium:{},conventicle:{},crematorium:{},crenelation:{},demarcation:{},maisonnette:{},observatory:{},reformatory:{},superstrate:{},tobacconist:{},trusteeship:{},wainscoting:{},amphitheater:{},amphitheatre:{},chapterhouse:{},clotheshorse:{},delicatessen:{},fountainhead:{},haberdashery:{},municipality:{},packinghouse:{},patriarchate:{},retrenchment:{},substructure:{},superstratum:{},surroundings:{},wainscotting:{},juxtaposition:{},infrastructure:{},dec:{},inn:{},loo:{},pub:{},burg:{},cafe:{},deli:{},dorm:{},hank:{},iglu:{},kirk:{},lair:{},lawn:{},mart:{},nave:{},oast:{},rink:{},souk:{},tine:{},tipi:{},veld:{},ways:{},wold:{},yurt:{},apsis:{},burgh:{},condo:{},cubby:{},cuddy:{},dacha:{},duchy:{},duomo:{},eaves:{},flies:{},gable:{},glade:{},gulag:{},harem:{},hogan:{},igloo:{},lanai:{},layby:{},mecca:{},midst:{},motel:{},oriel:{},parts:{},patio:{},polls:{},qibla:{},roads:{},rooms:{},sauna:{},skein:{},socle:{},soddy:{},sodom:{},spire:{},stoep:{},stupa:{},tenon:{},tepee:{},tupek:{},tupik:{},veldt:{},weald:{},abatis:{},abbacy:{},alcove:{},apiary:{},arbour:{},aviary:{},bedsit:{},bethel:{},bodega:{},bounds:{},bowels:{},cabana:{},calkin:{},campus:{},carrel:{},casbah:{},casern:{},chalet:{},depths:{},dolmen:{},donjon:{},dormer:{},durbar:{},eatery:{},escarp:{},fipple:{},flange:{},flyway:{},friary:{},furket:{},gantry:{},garret:{},hangar:{},hareem:{},hayrig:{},imaret:{},isobar:{},isohel:{},isolex:{},kasbah:{},laager:{},locale:{},loggia:{},marina:{},masjid:{},meadow:{},medina:{},menhir:{},merlon:{},midair:{},morgue:{},mosque:{},mudhif:{},musjid:{},pagoda:{},paling:{},pantry:{},parvis:{},pelmet:{},piazza:{},pigsty:{},plinth:{},priory:{},pueblo:{},radome:{},setoff:{},skybox:{},skyway:{},stalls:{},storey:{},suburb:{},tenter:{},upside:{},volary:{},wigwam:{},wikiup:{},winery:{},abattis:{},airdock:{},airlock:{},alcazar:{},antapex:{},apadana:{},apojove:{},apolune:{},athanor:{},barroom:{},bascule:{},bedside:{},beeline:{},borstal:{},boudoir:{},brewery:{},brewpub:{},brothel:{},campong:{},cannery:{},capitol:{},carport:{},carrell:{},chancel:{},chateau:{},citadel:{},coaming:{},corncob:{},cottage:{},cowbarn:{},cowshed:{},cowtown:{},crinion:{},dinette:{},diocese:{},earshot:{},edifice:{},enclave:{},exurbia:{},eyeshot:{},fantail:{},feedlot:{},firebox:{},screw:{},share:{},sheet:{},slice:{},slide:{},spill:{},stage:{},stake:{},tread:{},paddle:{},weight:{},canvass:{},compact:{},undercut:{},representation:{},fin:{},gag:{},jet:{},tug:{},bark:{},bunk:{},drum:{},mask:{},pipe:{},reel:{},scan:{},blank:{},drill:{},plumb:{},plume:{},shank:{},sling:{},spray:{},pickup:{},saddle:{},trench:{},capsule:{},security:{},sacrifice:{},technical:{},can:{},jar:{},map:{},ply:{},rib:{},rim:{},web:{},bell:{},buck:{},claw:{},comb:{},copy:{},crib:{},dish:{},fake:{},foil:{},grab:{},kite:{},ramp:{},rent:{},slot:{},spit:{},tank:{},bosom:{},cable:{},charm:{},drain:{},grave:{},price:{},skirt:{},stool:{},strap:{},stump:{},trail:{},access:{},cannon:{},fiddle:{},formal:{},insert:{},launch:{},purple:{},reward:{},strand:{},tackle:{},display:{},floater:{},incline:{},limited:{},portion:{},torpedo:{},overcast:{},puncture:{},broadside:{},duplicate:{},submarine:{},surcharge:{},production:{},interchange:{},bus:{},due:{},gap:{},jaw:{},lag:{},nut:{},tin:{},win:{},arch:{},bail:{},cell:{},dope:{},fell:{},film:{},lace:{},lash:{},mail:{},pale:{},purl:{},rate:{},skid:{},sole:{},spar:{},tuck:{},vamp:{},vent:{},vest:{},brake:{},brass:{},chuck:{},cramp:{},crest:{},drape:{},elbow:{},habit:{},lease:{},lower:{},prize:{},roach:{},royal:{},scrap:{},slate:{},snare:{},snuff:{},total:{},trump:{},beaver:{},canvas:{},future:{},handle:{},header:{},jacket:{},motley:{},muzzle:{},quiver:{},rocket:{},roller:{},staple:{},wrench:{},compass:{},element:{},exhaust:{},frontal:{},thunder:{},transit:{},upstage:{},traverse:{},accession:{},allowance:{},guarantee:{},promenade:{},shipwreck:{},attachment:{},protection:{},perpendicular:{},aid:{},gig:{},gin:{},nap:{},oil:{},ram:{},bead:{},bulb:{},curb:{},dart:{},daub:{},dial:{},dose:{},exit:{},fuse:{},goad:{},item:{},knit:{},plan:{},rein:{},swag:{},veil:{},alarm:{},chart:{},cinch:{},clasp:{},eagle:{},entry:{},fluff:{},gouge:{},lance:{},meter:{},miter:{},pouch:{},probe:{},punch:{},purse:{},sable:{},scuff:{},shear:{},stern:{},taper:{},thumb:{},wharf:{},whisk:{},barrel:{},beetle:{},bronze:{},burden:{},congee:{},fleece:{},glossy:{},halter:{},limber:{},margin:{},mobile:{},needle:{},remote:{},shroud:{},sketch:{},splice:{},stripe:{},toggle:{},trough:{},volume:{},ballast:{},binding:{},blanket:{},costume:{},crackle:{},crystal:{},diamond:{},fitting:{},graphic:{},harness:{},premium:{},product:{},pyramid:{},sandbag:{},squelch:{},trammel:{},uniform:{},venture:{},warrant:{},wildcat:{},working:{},assembly:{},charcoal:{},discount:{},envelope:{},imperial:{},ligature:{},original:{},specific:{},treasure:{},vertical:{},deduction:{},distemper:{},inventory:{},objective:{},reversion:{},whitewash:{},supplement:{},contrivance:{},convertible:{},inspiration:{},intersection:{},counterbalance:{},bet:{},gel:{},gut:{},jag:{},jig:{},pan:{},pry:{},tab:{},tax:{},zip:{},bait:{},barb:{},bomb:{},cone:{},cuff:{},dado:{},disk:{},gear:{},gore:{},grid:{},harp:{},loom:{},main:{},pant:{},pike:{},prod:{},reef:{},ruff:{},sham:{},tare:{},tidy:{},tire:{},toll:{},award:{},basic:{},basin:{},baton:{},birch:{},braid:{},broom:{},clack:{},cloak:{},clout:{},crock:{},fagot:{},ferry:{},filet:{},forte:{},found:{},frail:{},jolly:{},motor:{},pedal:{},potty:{},radio:{},rivet:{},scarf:{},shore:{},shunt:{},sieve:{},splat:{},splay:{},stave:{},steal:{},steel:{},thong:{},tithe:{},torch:{},trunk:{},twine:{},upper:{},valve:{},weave:{},bridle:{},buckle:{},buffet:{},carpet:{},cotton:{},custom:{},devise:{},enamel:{},entail:{},furrow:{},girdle:{},hobble:{},mangle:{},mosaic:{},motive:{},pallet:{},pencil:{},pinion:{},powder:{},radial:{},rattle:{},rebate:{},rumble:{},shield:{},shimmy:{},shovel:{},sledge:{},sluice:{},tablet:{},throne:{},timber:{},tinsel:{},uplift:{},benefit:{},bombard:{},bootleg:{},console:{},default:{},forfeit:{},freight:{},gantlet:{},generic:{},grapple:{},journal:{},loading:{},molding:{},overlap:{},pigment:{},plastic:{},salvage:{},scooter:{},scuffle:{},spindle:{},steamer:{},stopper:{},upright:{},carriage:{},catapult:{},facility:{},laminate:{},medicine:{},offstage:{},overload:{},plastron:{},railroad:{},retrofit:{},strickle:{},throttle:{},whipping:{},wireless:{},automatic:{},blackjack:{},blackwash:{},foliation:{},interlock:{},roughcast:{},threshold:{},antiseptic:{},camouflage:{},incidental:{},intangible:{},preventive:{},reversible:{},watercolor:{},maintenance:{},watercolour:{},differential:{},prescription:{},preventative:{},prophylactic:{},reproduction:{},transcription:{},transportation:{},fob:{},guy:{},hem:{},jug:{},kit:{},saw:{},cane:{},cart:{},clam:{},coif:{},cosy:{},cozy:{},disc:{},felt:{},gash:{},hone:{},hose:{},keel:{},loot:{},luff:{},lure:{},mast:{},mend:{},mine:{},muff:{},nuke:{},plow:{},robe:{},ruby:{},snip:{},soap:{},spud:{},swab:{},tile:{},till:{},tram:{},vane:{},wand:{},weed:{},weld:{},welt:{},audio:{},audit:{},baste:{},bilge:{},brail:{},bugle:{},canal:{},chest:{},chock:{},conge:{},couch:{},crape:{},crepe:{},crook:{},flute:{},frill:{},frock:{},fusee:{},hoist:{},inset:{},kitty:{},leash:{},liner:{},mixer:{},noose:{},novel:{},pearl:{},piano:{},plait:{},quill:{},reset:{},roost:{},saber:{},sabre:{},scull:{},spear:{},squab:{},stilt:{},sulky:{},video:{},vomit:{},wagon:{},aerial:{},armory:{},baffle:{},banner:{},batten:{},binder:{},bodkin:{},bypass:{},canopy:{},chisel:{},clench:{},dollar:{},dredge:{},drogue:{},duster:{},engine:{},excise:{},facing:{},funnel:{},garner:{},hamper:{},joggle:{},kettle:{},lining:{},livery:{},lumber:{},marble:{},mortar:{},mousse:{},nickel:{},ocular:{},payoff:{},pestle:{},piping:{},pommel:{},profit:{},puzzle:{},ransom:{},ration:{},rental:{},ribbon:{},rotary:{},runway:{},saucer:{},seesaw:{},siphon:{},suture:{},tattoo:{},thatch:{},throat:{},tunnel:{},turtle:{},wealth:{},acrylic:{},armoury:{},balloon:{},bargain:{},beehive:{},blinker:{},bolster:{},caisson:{},casting:{},ceiling:{},chariot:{},chopper:{},clarion:{},clinker:{},clipper:{},cowhide:{},earnest:{},elastic:{},expense:{},festoon:{},fortune:{},garnish:{},gravure:{},grinder:{},killing:{},linkage:{},novelty:{},overall:{},overlay:{},pallium:{},perfume:{},pillory:{},pointer:{},ringlet:{},rosette:{},segment:{},shuttle:{},staging:{},trailer:{},trumpet:{},unction:{},barbecue:{},barbeque:{},disguise:{},electric:{},elevated:{},fraction:{},gauntlet:{},gossamer:{},heritage:{},homespun:{},ironclad:{},lifeline:{},lighting:{},mackinaw:{},moulding:{},pinpoint:{},pinwheel:{},poundage:{},sanguine:{},sapphire:{},scribble:{},triangle:{},underlay:{},upstairs:{},virginal:{},admission:{},amphibian:{},backstage:{},capillary:{},cartridge:{},cartwheel:{},cathartic:{},condenser:{},damascene:{},depiction:{},diaphragm:{},medallion:{},overdrive:{},pacemaker:{},reservoir:{},screening:{},sectional:{},solitaire:{},spotlight:{},undercoat:{},assessment:{},bottleneck:{},equatorial:{},overburden:{},pigeonhole:{},pocketbook:{},pontifical:{},refractory:{},reparation:{},roundabout:{},simulation:{},waterproof:{},accelerator:{},certificate:{},inheritance:{},installment:{},restorative:{},ventilation:{},modification:{},subscription:{},hospitalization:{},instrumentation:{},ax:{},axe:{},bib:{},bin:{},bur:{},cot:{},fee:{},fur:{},jib:{},lid:{},six:{},ten:{},tub:{},two:{},bath:{},bike:{},cash:{},coke:{},cope:{},cowl:{},cusp:{},darn:{},debt:{},dice:{},dory:{},duct:{},fore:{},four:{},gaff:{},gage:{},gong:{},helm:{},hemp:{},icon:{},iris:{},junk:{},kern:{},loan:{},maul:{},mink:{},pane:{},pier:{},quid:{},reed:{},rook:{},scum:{},semi:{},sump:{},swob:{},taxi:{},vice:{},ware:{},wool:{},yarn:{},yawl:{},annex:{},atlas:{},barge:{},bevel:{},chaff:{},chute:{},clamp:{},crane:{},crate:{},cubeb:{},dandy:{},dicky:{},dinky:{},dolly:{},dower:{},eight:{},fifty:{},flail:{},floss:{},folio:{},fuzee:{},genre:{},girth:{},gourd:{},grape:{},hinge:{},hobby:{},inlay:{},japan:{},ladle:{},latch:{},linen:{},means:{},mitre:{},motif:{},mulct:{},pique:{},quilt:{},quirk:{},quota:{},rifle:{},rotor:{},setup:{},seven:{},shred:{},skate:{},spade:{},spool:{},spout:{},strut:{},three:{},toner:{},trawl:{},truck:{},twill:{},virtu:{},alpaca:{},anklet:{},argyle:{},argyll:{},arnica:{},balsam:{},bender:{},birdie:{},bishop:{},blower:{},blowup:{},bolero:{},bonnet:{},bounty:{},budget:{},bullet:{},cachet:{},carbon:{},casket:{},castor:{},claxon:{},cobble:{},cobweb:{},collet:{},crenel:{},cutoff:{},cutout:{},damask:{},damper:{},dibble:{},dickey:{},dipper:{},domino:{},douche:{},dragee:{},equity:{},eyelet:{},fetish:{},foible:{},fresco:{},gaiter:{},gibbet:{},gusset:{},heckle:{},hooter:{},horror:{},hunter:{},intake:{},jigger:{},lacing:{},lappet:{},makeup:{},making:{},mallet:{},marker:{},patina:{},paving:{},platen:{},plough:{},poleax:{},portal:{},primer:{},rabbet:{},rattan:{},refill:{},retort:{},revere:{},screed:{},sheath:{},sinker:{},socket:{},splint:{},stereo:{},syphon:{},tamper:{},tandem:{},tarmac:{},tenure:{},ticker:{},trepan:{},twenty:{},velvet:{},veneer:{},vessel:{},vicuna:{},backing:{},bandage:{},bobsled:{},carving:{},central:{},chamfer:{},chequer:{},cistern:{},cleaner:{},cleanup:{},coinage:{},crochet:{},cruiser:{},curtain:{},dilator:{},distaff:{},emerald:{},etching:{},flannel:{},flounce:{},footing:{},gangway:{},garbage:{},garland:{},gauffer:{},gelatin:{},grizzle:{},hanging:{},haywire:{},lamella:{},laniard:{},lanyard:{},lashing:{},lockage:{},lounger:{},manakin:{},masking:{},meshing:{},mileage:{},mintage:{},mortice:{},mortise:{},movable:{},muffler:{},palette:{},pendant:{},pendent:{},pennant:{},pillbox:{},poleaxe:{},portage:{},pottery:{},priming:{},quarrel:{},readout:{},retread:{},roundel:{},rubbing:{},scupper:{},scuttle:{},serpent:{},shampoo:{},shellac:{},shutter:{},snaffle:{},snorkel:{},spangle:{},spouter:{},stabile:{},stinker:{},tankage:{},toehold:{},tracing:{},treadle:{},trefoil:{},truckle:{},trundle:{},vesture:{},webbing:{},whipsaw:{},wrapper:{},additive:{},adjuvant:{},aperture:{},aquatint:{},backdoor:{},basilisk:{},blowback:{},bludgeon:{},breakage:{},causeway:{},checkout:{},clincher:{},compress:{},corduroy:{},coupling:{},crossbar:{},currency:{},detector:{},dividend:{},dogtooth:{},downcast:{},followup:{},frontage:{},giveaway:{},goodwill:{},hardware:{},headgear:{},headshot:{},hypnotic:{},ignition:{},inhalant:{},lipstick:{},masthead:{},meniscus:{},metallic:{},modeling:{},nautilus:{},neckband:{},nightcap:{},ornament:{},outboard:{},partizan:{},pavement:{},pectoral:{},planking:{},plumbing:{},portable:{},pressing:{},radiator:{},remittal:{},residual:{},resource:{},roulette:{},scaffold:{},scapular:{},scissors:{plural:"scissors"},scrabble:{},springer:{},sunburst:{},tapestry:{},taxation:{},thrasher:{},tomahawk:{},totality:{},tympanum:{},valuable:{},vignette:{},wardrobe:{},widening:{},admixture:{},antiquity:{},aquaplane:{},bagatelle:{},bastinado:{},blindfold:{},blueprint:{},boomerang:{},carpetbag:{},crinoline:{},depressor:{},detergent:{},doodlebug:{},downstage:{},emergency:{},endowment:{},equalizer:{},exemption:{},extortion:{},extractor:{},facsimile:{},freewheel:{},gabardine:{},grotesque:{},hemstitch:{},horseshoe:{},invention:{},jackknife:{},microwave:{},millstone:{},miniature:{},modernism:{},nosepiece:{},ownership:{},packaging:{},pargeting:{},patchwork:{},pinstripe:{},polyester:{},potpourri:{},recording:{},refresher:{},semaphore:{},semblance:{},shielding:{},sideboard:{},skyrocket:{},slapstick:{},soporific:{},spectacle:{},starboard:{},telephone:{},telescope:{},treadmill:{},turntable:{},verdigris:{},videotape:{},whirligig:{},allocation:{},ambulatory:{},anesthetic:{},assistance:{},astringent:{},automation:{},cantilever:{},chinchilla:{},concertina:{},constraint:{},deductible:{},depilatory:{},disposable:{},elongation:{},escutcheon:{},featherbed:{},foreground:{},forfeiture:{},guillotine:{},hammerhead:{},hydroplane:{},innovation:{},intoxicant:{},knockabout:{},lithograph:{},monochrome:{},nonpayment:{},nutcracker:{},pargetting:{},peripheral:{},polychrome:{},redemption:{},stabilizer:{},stenograph:{},subvention:{},sustenance:{},technology:{},television:{},waterspout:{},anaesthetic:{},anamorphism:{},concealment:{},containment:{},copperplate:{},cornerstone:{},counterfeit:{},countersink:{},cryptograph:{},delineation:{},delinquency:{},encumbrance:{},fingerboard:{},fluorescent:{},incumbrance:{},perforation:{},pyrotechnic:{},retribution:{},subsistence:{},tensiometer:{},transporter:{},undercharge:{},withholding:{},dispensation:{},electrolytic:{},encrustation:{},inclinometer:{},incrustation:{},installation:{},intermixture:{},photogravure:{},straightaway:{},transparency:{},appropriation:{},embellishment:{},improvisation:{},merchandising:{},mystification:{},quadruplicate:{},semiautomatic:{},pharmaceutical:{},superannuation:{},aba:{},boa:{},dag:{},fax:{},gad:{},keg:{},nib:{},nog:{},pix:{},pyx:{},rep:{},ski:{},taw:{},urn:{},ante:{},arms:{},bale:{},berm:{},bier:{},bitt:{},bola:{},bolo:{},brad:{},cape:{},cask:{},cent:{},coax:{},coca:{},cosh:{},dime:{},dole:{},doll:{},garb:{},gilt:{},gyro:{},hasp:{},hypo:{},ikon:{},juju:{},lane:{},lint:{},luge:{},lute:{},maxi:{},maze:{},mini:{},mitt:{},mule:{},pail:{},perk:{},plat:{},pork:{},pouf:{},rung:{},scow:{},silk:{},sill:{},skep:{},sled:{},tamp:{},tapa:{},topi:{},trey:{},vape:{},wale:{},wick:{},adobe:{},aegis:{},aglet:{},album:{},alley:{},anode:{},anvil:{},arrow:{},auger:{},batik:{},bogie:{},bolus:{},bongo:{},borer:{},bribe:{},bulla:{},caddy:{},canoe:{},chime:{},coign:{},debit:{},denim:{},depot:{},diary:{},diode:{},drier:{},flask:{},flume:{},fount:{},frier:{},fryer:{},gauze:{},globe:{},golem:{},hijab:{},inlet:{},jimmy:{},jorum:{},kayak:{},khaki:{},lasso:{},latex:{},lisle:{},lorry:{},lucre:{},manta:{},mimeo:{},mizen:{},moire:{},mulch:{},newel:{},nylon:{},penny:{},piste:{},plush:{},poker:{},prism:{},pyxis:{},ranch:{},razor:{},relic:{},rouge:{},ruler:{},sabot:{},scape:{},sedan:{},seine:{},servo:{},shelf:{plural:"shelves"},slops:{},spoke:{},sprig:{},stele:{},steps:{},stoup:{},stove:{},strop:{},suede:{},swage:{},tammy:{},tanka:{},tappa:{},teddy:{},terms:{},toque:{},torus:{},towel:{},tunic:{},tweed:{},usury:{},verso:{},vizor:{},waist:{},winch:{},withe:{},xerox:{},yacht:{},abacus:{},afghan:{},aiglet:{},alidad:{},amends:{},arctic:{},artery:{},avenue:{},banger:{},bangle:{},banian:{},banyan:{},bauble:{},beaker:{},bicorn:{},blazon:{},boiler:{},bracer:{},broach:{},bumper:{},burner:{},buzzer:{},caftan:{},calash:{},camera:{},camion:{},camlet:{},capote:{},carton:{},casein:{},catgut:{},chaise:{},cheque:{},chiton:{},chukka:{},cither:{},cloaca:{},cloche:{},coffer:{},coffin:{},coigne:{},colors:{},corbel:{},corker:{},corset:{},crayon:{},crutch:{},dagger:{},daybed:{},detour:{},diaper:{},dickie:{},dipole:{},dirndl:{},discus:{},dogleg:{},dolman:{},dosage:{},duffel:{},duffle:{},eyecup:{},fabric:{},facade:{},falsie:{},fanjet:{},fascia:{},fetter:{},firkin:{},fizgig:{},floppy:{},frieze:{},garter:{},gimlet:{},goblet:{},guimpe:{},guinea:{},gunnel:{},harrow:{},helmet:{},hookup:{},hotbed:{},impost:{},instep:{},iodine:{},island:{},jersey:{},jetsam:{},jigsaw:{},juicer:{},kaftan:{},kibble:{},kirtle:{},lateen:{},laurel:{},ledger:{},linage:{},lunula:{},magnet:{},markup:{},miotic:{},mizzen:{},myotic:{},nipple:{},nozzle:{},onager:{},pajama:{},pavage:{},pellet:{},pennon:{},peplum:{},peyote:{},pincer:{},pipage:{},pomade:{},pompon:{},popper:{},pyjama:{},ragbag:{},reamer:{},remake:{},reseau:{},rudder:{},russet:{},scythe:{},settee:{},shades:{},shorts:{},siding:{},sleeve:{},sleigh:{},spinet:{},spline:{},stoker:{},stylus:{},sublet:{},subway:{},surtax:{},swathe:{},swivel:{},syrinx:{},taenia:{},talcum:{},tariff:{},teacup:{},teeter:{},tenner:{},tether:{},thwart:{},tocsin:{},trophy:{},trowel:{},turban:{},viewer:{},waggon:{},wampum:{},wherry:{},wicker:{},willow:{},wiring:{},woolen:{},yarder:{},zipper:{},acetate:{},aerosol:{},airline:{},alidade:{},ampulla:{},android:{},aneroid:{},annulet:{},anodyne:{},apanage:{},apparel:{},archive:{},armband:{},armilla:{},arrears:{},banding:{},basting:{},batting:{},bayonet:{},beading:{},bedding:{},bladder:{},blocker:{},blusher:{},bollock:{},bouquet:{},bracing:{},brocade:{},broiler:{},bullion:{},bunting:{},burthen:{},bushing:{},caleche:{},caliper:{},cathode:{},catwalk:{},cautery:{},charger:{},charnel:{},chemise:{},chevron:{},chimney:{},chlamys:{},circlet:{},colours:{},commode:{},cooling:{},cordage:{},coronet:{},corsair:{},crampon:{},cutaway:{},daybook:{},deadeye:{},decoder:{},diagram:{},doeskin:{},dogsled:{},doormat:{},dragger:{},dragnet:{},drapery:{},drawers:{},dustpan:{},escheat:{},eyehole:{},fixings:{},flatbed:{},flattop:{},flipper:{},foghorn:{},foliage:{},footage:{},foretop:{},forgery:{},frigate:{},funding:{},furring:{},fustian:{},garment:{},garotte:{},garrote:{},gouache:{},grapnel:{},griddle:{},hackney:{},hammock:{},harpoon:{},hassock:{},hatchel:{},hatchet:{},heating:{},hedging:{},hibachi:{},hobnail:{},holding:{},holster:{},hydrant:{},iceboat:{},igniter:{},impasse:{},ironing:{},jackpot:{},javelin:{},joinery:{},fibre:{},hazel:{},lemon:{},peach:{},plank:{},raven:{},snipe:{},spine:{},steer:{},stint:{},stunt:{},bleach:{},breath:{},callus:{},cherry:{},dimple:{},entire:{},ferret:{},filler:{},hybrid:{},jackal:{},marrow:{},orange:{},radish:{},spruce:{},stifle:{},winkle:{},endemic:{},vanilla:{},beefwood:{},calabash:{},concrete:{},emission:{},kingfish:{},solution:{},volatile:{},partridge:{},repellant:{},derivative:{},thickening:{},ash:{},bud:{},cob:{},hen:{},mew:{},mud:{},mum:{},paw:{},roe:{},sow:{},soy:{},wax:{},yam:{},beef:{},burl:{},calf:{plural:"calves"},chat:{},fowl:{},fuzz:{},gill:{},grub:{},hock:{},hoof:{},lobe:{},rose:{},scup:{},soup:{},swan:{},tint:{},tuna:{},tusk:{},alloy:{},briar:{},clove:{},coney:{},ebony:{},ether:{},filth:{},flesh:{},gumbo:{},homer:{},jelly:{},matte:{},mocha:{},reeve:{},wrack:{},annual:{},canine:{},carrot:{},cereal:{},cockle:{},feeler:{},fennel:{},flimsy:{},gargle:{},gravel:{},grouse:{},indigo:{},mammee:{},medlar:{},monkey:{},nebula:{},oyster:{},salmon:{plural:"salmon"},shiner:{},shrimp:{},sprout:{},stigma:{},blossom:{},blubber:{},buffalo:{},cabbage:{},calamus:{},catfish:{},caudate:{},caustic:{},chelate:{},chicory:{},ciliate:{},essence:{},griffon:{},hemlock:{},hydrate:{},incense:{},lighter:{},remount:{},sardine:{},stinger:{},vitriol:{},ambrosia:{},billfish:{},blackcap:{},crawfish:{},crayfish:{},earthnut:{},escallop:{},filament:{},flounder:{},infusion:{},ironwood:{},quandong:{},relative:{},ringtail:{},screamer:{},sycamore:{},alabaster:{},algarroba:{},broadbill:{},composite:{},fulminate:{},perennial:{},tangerine:{},bladderpod:{},granadilla:{},heartsease:{},periwinkle:{},tumbleweed:{},agglomerate:{},bittersweet:{},intermediate:{},dye:{},elk:{},fig:{},haw:{},oka:{},pea:{},pee:{},rye:{},sac:{},tar:{},yak:{},carp:{},clay:{},coma:{},cony:{},crud:{},cusk:{},dung:{},fang:{},foam:{},germ:{},glue:{},hare:{},hind:{},husk:{},kiwi:{},lake:{},mung:{},okra:{},pine:{},pith:{},puke:{},rice:{},roan:{},sloe:{},taro:{},teal:{},yellow:{},titi:{},twig:{},amber:{},anime:{},berry:{},boxer:{},carob:{},cedar:{},chine:{},guava:{},hound:{},husky:{},kauri:{},lemma:{},monad:{},ocher:{},ochre:{},onion:{},ounce:{},pansy:{},pecan:{},pewit:{},prawn:{},quail:{},shuck:{},sloth:{},slush:{},smelt:{},snail:{},snout:{},spawn:{},swift:{},tabby:{},thorn:{},topaz:{},umber:{},virus:{},wafer:{},wahoo:{},wheat:{},whelk:{},badger:{},bonito:{},broody:{},chrome:{},cirrus:{},cocoon:{},cowpea:{},cuckoo:{},elixir:{},grease:{},grubby:{},howler:{},jabiru:{},jargon:{},jujube:{},kernel:{},leaven:{},lentil:{},liquor:{},locust:{},manioc:{},mastic:{},mentum:{},mildew:{},mimosa:{},mullet:{},muscat:{},mutant:{},nectar:{},nettle:{},nodule:{},pawpaw:{},pecker:{},plasma:{},ruddle:{},sallow:{},shoddy:{},squill:{},starch:{},stroma:{},stucco:{},sunray:{},thorax:{},tissue:{},violet:{},walnut:{},warble:{},amyloid:{},antenna:{plural:"antennae"},apricot:{},aquatic:{},terrestrial:{},asphalt:{},avocado:{},beebalm:{},bobtail:{},builder:{},bulldog:{},caltrop:{},cayenne:{},chinook:{},coconut:{},cricket:{},cudweed:{},currant:{},cuticle:{},dasheen:{},gallfly:{},juniper:{},lacquer:{},leaflet:{},lettuce:{},macadam:{},mordant:{},mustard:{},packing:{},panther:{},papilla:{},papyrus:{},parsnip:{},pigweed:{},pollard:{},redfish:{},redwood:{},rubbish:{},saffron:{},salsify:{},shallot:{},slating:{},solvate:{},solvent:{},soybean:{},sunfish:{},truffle:{},whisker:{},abrasive:{},allspice:{},angelica:{},biennial:{},bilberry:{},bluebell:{},chickpea:{},cinnabar:{},cinnamon:{},congener:{},creosote:{},demerara:{},duckbill:{},firebird:{},fleabane:{},humanity:{},lavender:{},mahogany:{},monkfish:{},paraffin:{},peduncle:{},peroxide:{},plantain:{},rockfish:{},sandarac:{},sandwort:{},scammony:{},shamrock:{},skipjack:{},skullcap:{},snowbird:{},suckling:{},tubercle:{},alligator:{},angelfish:{},arachnoid:{},arrowroot:{},bearberry:{},blackfish:{},buckthorn:{},capitulum:{},carbonate:{},carnation:{},celluloid:{},chemistry:{},coriander:{},corrosive:{},crabapple:{},devilfish:{},emanation:{},groundnut:{},horseback:{},horsemint:{},injection:{},matchwood:{},mistletoe:{},offspring:{plural:"offspring"},pyrethrum:{},raspberry:{},razorback:{},satinwood:{},sheepskin:{},tomatillo:{},waxflower:{},whitefish:{},ammunition:{},bitterwood:{},blackberry:{},butterfish:{},chinquapin:{},coneflower:{},flagellate:{},flamboyant:{},fledgeling:{},insulation:{},peppermint:{},receptacle:{},strawberry:{},watercress:{},chittamwood:{},everlasting:{},fomentation:{},helleborine:{},honeysuckle:{},horseradish:{},huckleberry:{},salmonberry:{},shittimwood:{},strawflower:{},ultramarine:{},whitethroat:{},wintergreen:{},helmetflower:{},impregnation:{},quintessence:{},sternutatory:{},thimbleberry:{},contamination:{},extravasation:{},leatherjacket:{},pulverisation:{},pulverization:{},tortoiseshell:{},ti:{},ala:{},asp:{},eel:{},elm:{},fir:{},gar:{},neb:{},nit:{},oak:{},oat:{},sol:{},tom:{},yew:{},agar:{},akee:{},anil:{},atom:{},balm:{},bast:{},beet:{},boar:{},bole:{},bran:{},brit:{},cere:{},cero:{},chow:{},coho:{},dahl:{},dill:{},flax:{},foal:{},glop:{},gnat:{},hake:{},herb:{},hoar:{},homo:{},kaki:{},kino:{},leek:{},loin:{},mite:{},musk:{},parr:{},pear:{},poon:{},puka:{},rhea:{},saki:{},seta:{},shad:{},silt:{},slag:{},soda:{},soma:{},soot:{},soya:{},talc:{},teak:{},tufa:{},unai:{},unau:{},whey:{},woad:{},wort:{},yolk:{},zinc:{},abaca:{},alder:{},alula:{},amino:{},anise:{},apple:{},aroid:{},aster:{},balsa:{},basil:{},beech:{},betel:{},biddy:{},billy:{},biped:{},booby:{},britt:{},bruin:{},cairn:{},capon:{},caulk:{},chard:{},chess:{},chick:{},cisco:{},cohoe:{},comma:{},croup:{},cumin:{},dross:{},elver:{},epoxy:{},ergot:{},falls:{},flint:{},fossa:{},genip:{},grout:{},grume:{},henna:{},hilum:{},humus:{},hydra:{},icaco:{},ilama:{},imago:{},ivory:{},kapok:{},kenaf:{},lapin:{},larch:{},lilac:{},lotus:{},luffa:{},mahoe:{},maize:{},mamey:{},mango:{},manna:{},melon:{},moong:{},naiad:{},nanny:{},nopal:{},orris:{},osier:{},otter:{},ovary:{},ovule:{},pacer:{},panda:{},papaw:{},piggy:{},pilus:{},pinna:{},pixie:{},polyp:{},potto:{},putty:{},quira:{},robin:{},roble:{},rosin:{},scrod:{},sepia:{},sisal:{},slime:{},sorus:{},sprat:{},squid:{},stoma:{},sumac:{},swede:{},theca:{},thyme:{},trout:{plural:"trout"},tunny:{},vapor:{},velum:{},venom:{},vinyl:{},whelp:{},yeast:{},acetum:{},acinus:{},acumen:{},adduct:{},agaric:{},alkali:{},almond:{},anuran:{},archil:{},argent:{},balata:{},bamboo:{},bantam:{},barley:{},basset:{},beluga:{},bennet:{},bluing:{},bonduc:{},borage:{},capsid:{},cashew:{},cassia:{},caudex:{},celery:{},chives:{},cilium:{},citron:{},cobnut:{},cocker:{},cosmos:{},cowage:{},croton:{},cupule:{},cushaw:{},darter:{},dentin:{},dobson:{},dodder:{},donkey:{},durian:{},embryo:{},endive:{},ermine:{},falcon:{},feijoa:{},feline:{},fisher:{},fucoid:{},gadfly:{},garlic:{},glycol:{},hackle:{},haunch:{},herpes:{},hyssop:{},kaffir:{},kitten:{},lichee:{},limpet:{},linden:{},linnet:{},litchi:{},loofah:{},loquat:{},lovage:{},lupine:{},madder:{},maguey:{},manure:{},marang:{},mescal:{},mocker:{},mombin:{},mucoid:{},mudcat:{},munggo:{},murine:{},mussel:{},myrtle:{},nipper:{},nutmeg:{},obeche:{},orchil:{},orchis:{},oriole:{},padauk:{},paigle:{},papaya:{},parget:{},pasang:{},peewee:{},peewit:{},phenol:{},plaice:{},pomelo:{},poplar:{},possum:{},potato:{},pothos:{},pouter:{},puffer:{},pullet:{},pumice:{},pyrene:{},quahog:{},quartz:{},quince:{},rachis:{},raffia:{},ratter:{},relict:{},sabicu:{},saline:{},sapote:{},saurel:{},schrod:{},senega:{},septum:{},setter:{},sierra:{},simian:{},sludge:{},solder:{},spirea:{},stevia:{},sulfur:{},thrift:{},toetoe:{},tomato:{},tophus:{},triton:{},tupelo:{},turbot:{},turnip:{},vapour:{},vellum:{},wapiti:{},wasabi:{},acerola:{},actinon:{},aculeus:{},adamant:{},albumen:{},alewife:{},alfalfa:{},amboyna:{},anchovy:{},anemone:{},anionic:{},annelid:{},annulus:{},antacid:{},antlion:{},arsenic:{},aurochs:{},babbitt:{},barilla:{},beeswax:{},bimetal:{},biomass:{},bloomer:{},blotter:{},bluefin:{},blueing:{},boneset:{},boxwood:{},bracken:{},brocket:{},bromide:{},buckeye:{},bugbane:{},bugloss:{},bullock:{},bulrush:{},buzzard:{},cackler:{},cacodyl:{},caliche:{},calycle:{},cambium:{},capulin:{},caraway:{},cardoon:{},catbird:{},catechu:{},celtuce:{},ceriman:{},chalaza:{},chamois:{},chervil:{},chigger:{},citrate:{},cocoyam:{},codfish:{},comfrey:{},compost:{},cowslip:{},crappie:{},crawdad:{},crinoid:{},cyanide:{},cypress:{},dabbler:{},denizen:{},diploid:{},dogfish:{},dogwood:{},echidna:{},eelpout:{},enation:{},fallout:{},ferrite:{},fetlock:{},filaria:{},filbert:{},firebug:{},firefly:{},frijole:{},fuchsia:{},gamboge:{},ginseng:{},girasol:{},glutton:{},gobbler:{},grackle:{},grampus:{},granite:{},grizzly:{},grouper:{},grunter:{},gudgeon:{},haddock:{},halibut:{},haploid:{},haricot:{},heather:{},hepatic:{},herring:{},hickory:{},hogfish:{},honesty:{},hyaline:{},ignitor:{},inducer:{},jackass:{},jewfish:{},jonquil:{},kestrel:{},kingcup:{},kumquat:{},lactate:{},langsat:{},lanolin:{},lingcod:{},lobster:{},logwood:{},mahagua:{},majagua:{},malacca:{},mammoth:{},marabou:{},marasca:{},menthol:{},mercury:{},monarch:{},moneran:{},mongrel:{},moorhen:{},morello:{},muskrat:{},nervure:{},nitrate:{},octopus:{},oldwife:{},opossum:{},oregano:{},ostrich:{},oxheart:{},parsley:{},peacock:{},pigfish:{},pimento:{},piranha:{},plumcot:{},pollack:{},pollock:{},pompano:{},popcorn:{},poultry:{},pricket:{},puccoon:{},pulasan:{},pyrogen:{},quahaug:{},quassia:{},quetzal:{},raccoon:{},ragweed:{},ragwort:{},rattler:{},redbird:{},redpoll:{},redtail:{},reducer:{},redwing:{},remover:{},residue:{},retinal:{},rhubarb:{},rosebud:{},rostrum:{},satsuma:{},saurian:{},sequoia:{},seriema:{},skylark:{},sockeye:{},soursop:{},sparrow:{},spinach:{},spiraea:{},stentor:{},steroid:{},stubble:{},sulfate:{},sulphur:{},tangelo:{},taproot:{},tarweed:{},tarwood:{},tattler:{},taurine:{},teargas:{},timothy:{},tobacco:{},topknot:{},tortrix:{},trotter:{},varmint:{},verdure:{},viceroy:{},vinegar:{},viscose:{},vulture:{},walleye:{},waratah:{},warbler:{},waxwork:{},whooper:{},wilding:{},witloof:{},wryneck:{},abradant:{},absinthe:{},acceptor:{},actinoid:{},adhesive:{},adjutant:{},ageratum:{},agueweed:{},albacore:{},amarelle:{},amethyst:{},ammoniac:{},argonaut:{},armyworm:{},auricula:{},balancer:{},baldpate:{},barnacle:{},basswood:{},bayberry:{},bearskin:{},beetroot:{},birdlime:{},blackfly:{},blacktop:{},bluebird:{},bluefish:{},boarfish:{},bocconia:{},boxberry:{},brisling:{},broccoli:{},buckskin:{},bullhead:{},bullrush:{},canistel:{},capuchin:{},carangid:{},carbonyl:{},carboxyl:{},cardamom:{},cardamon:{},carinate:{},carnauba:{},carotene:{},cashmere:{},catalyst:{},catchfly:{},celeriac:{},cetacean:{},chimaera:{},chloride:{},cilantro:{},cinchona:{},citrange:{},cockspur:{},conodont:{},costmary:{},cowberry:{},cucumber:{},deadwood:{},detritus:{},dewberry:{},dilution:{},dolomite:{},duckling:{},ectozoan:{},eelgrass:{},effluent:{},eggplant:{},emulsion:{},estragon:{},filtrate:{},fireweed:{},flathead:{},flooring:{},forelock:{},galangal:{},garbanzo:{},grayback:{},guaiacum:{},hardtack:{},harebell:{},hawkweed:{},hazelnut:{},hedgehog:{},hepatica:{},hookworm:{},hornwort:{},horsefly:{},hyacinth:{},impurity:{},iodoform:{},jalapeno:{},jamberry:{},japonica:{},keurboom:{},kindling:{},kingwood:{},kinkajou:{},kohlrabi:{},labdanum:{},lambskin:{},locoweed:{},lovebird:{},magnolia:{},mahimahi:{},mandrake:{},margarin:{},marjoram:{},medusoid:{},mephitis:{},migrator:{},molecule:{},moonfish:{},mucilage:{},mulberry:{},nestling:{},omnivore:{},ovenbird:{},pandanus:{},pickerel:{},pilchard:{},pimiento:{},pitahaya:{},placenta:{},plumbago:{},predator:{},ptomaine:{},puffball:{},pulassan:{},purebred:{},pyrectic:{},quandang:{},quickset:{},rambotan:{},rambutan:{},redberry:{},redstart:{},reedbird:{},ricebird:{},richweed:{},ringdove:{},rockrose:{},rosefish:{},rosemary:{},rosewood:{},ruminant:{},rutabaga:{},sailfish:{},salsilla:{},saltwort:{},sandfish:{},scallion:{},seahorse:{},sealskin:{},sewerage:{},shoveler:{},siderite:{},silkworm:{},sparling:{},squealer:{},squirrel:{},stearate:{},stinkpot:{},superbug:{},surffish:{},sweetsop:{},tamarind:{},tarragon:{},teaberry:{},thresher:{},throstle:{},tilefish:{},tomentum:{},toxicant:{},turmeric:{},ungulate:{},univalve:{},urochord:{},vesicant:{},warragal:{},warrigal:{},watchdog:{},waxberry:{},weakfish:{},wolffish:{},woodbine:{},woodruff:{},wormcast:{},wriggler:{},zucchini:{},absorbent:{},adsorbate:{},adsorbent:{},albatross:{},almandine:{},andromeda:{},antiknock:{},apophysis:{},archangel:{},arsenical:{},artichoke:{},asparagus:{},aubergine:{},bacteroid:{},blackbird:{},blindworm:{},bluegrass:{},bluepoint:{},broadtail:{},brooklime:{},brookweed:{},brushwood:{},buckwheat:{},bugleweed:{},buteonine:{},butternut:{},caecilian:{},calyculus:{},candlenut:{},cantaloup:{},carambola:{},carbonado:{},carbuncle:{},cardboard:{},carnivore:{},catamount:{},celandine:{},chameleon:{},chatterer:{},chelonian:{},cherimoya:{},chickweed:{},chlamydia:{},clamshell:{},clapboard:{},coachwhip:{},cochineal:{},cocklebur:{},cocozelle:{},coltsfoot:{},commensal:{},courgette:{},crackling:{},cupflower:{},cyanamide:{},digestive:{},digitalis:{},driftfish:{},ecrevisse:{},ectoplasm:{},eiderdown:{},ephemeral:{},eutherian:{},evergreen:{},excretion:{},exudation:{},fenugreek:{},firebrand:{},firestone:{},flagellum:{},frostweed:{},funiculus:{},gladiolus:{},glasswort:{},goldeneye:{},goldfinch:{},grapevine:{},grenadier:{},hackberry:{},hamadryad:{},heartleaf:{},hellebore:{},hollyhock:{},horehound:{},horsebean:{},horsehair:{},horseweed:{},hortensia:{},hydroxide:{},jackfruit:{},jacksnipe:{},jellyfish:{},juneberry:{},lancewood:{},langouste:{},leavening:{},lemonwood:{},mammalian:{},manzanita:{},maravilla:{},marihuana:{},marijuana:{},moosewood:{},muscadine:{},muskmelon:{},nakedwood:{},nectarine:{},nighthawk:{},pasturage:{},patchouli:{},patchouly:{},pelecypod:{},pellitory:{},peregrine:{},peristome:{},persimmon:{},phosphate:{},pimpernel:{},pinchbeck:{},pineapple:{},pistachio:{},polyploid:{},probiotic:{},proboscis:{},protozoan:{},pureblood:{},quadruped:{},rauwolfia:{},recycling:{},reptilian:{},reticulum:{},rockcress:{},rootstock:{},rosinweed:{},sandpaper:{},sapodilla:{},sassafras:{},sheldrake:{},shingling:{},shoveller:{},siccative:{},sicklepod:{},snakeroot:{},snowflake:{},sourdough:{},spicebush:{},spirillum:{},stainless:{},stiffener:{},strangler:{},strawworm:{},sugarcane:{},swordfish:{},tamarindo:{},tarantula:{},topminnow:{},tulipwood:{},turquoise:{},twayblade:{},twinberry:{},wallpaper:{},whitebait:{},whiteface:{},wineberry:{},wolverine:{},workhorse:{},adulterant:{},amygdaloid:{},anopheline:{},aquamarine:{},belladonna:{},bellwether:{},bitterweed:{},blacksnake:{},blackthorn:{},bluebonnet:{},bluebottle:{},bottlenose:{},brachiopod:{},brazilwood:{},breadfruit:{},butterball:{},butterweed:{},candelilla:{},cantaloupe:{},catarrhine:{},cellulosic:{},chatterbox:{},chinaberry:{},cinquefoil:{},citronwood:{},clementine:{},condensate:{},copperhead:{},coralberry:{},cornflower:{},cottonweed:{},cottonwood:{},crossbreed:{},crustacean:{},deathwatch:{},demoiselle:{},dollarfish:{},elderberry:{},exhalation:{},feathertop:{},fetterbush:{},fiddlehead:{},flycatcher:{},fritillary:{},garambulla:{},goldenbush:{},gooseberry:{},grapefruit:{},jaboticaba:{},jackrabbit:{},ketembilla:{},kitembilla:{},lemongrass:{},littleneck:{},loganberry:{},loggerhead:{},mangosteen:{},marblewood:{},marguerite:{},massasauga:{},meerschaum:{},monoclonal:{},nasturtium:{},needlefish:{},nonstarter:{},ornamental:{},pacesetter:{},parenchyma:{},pennyroyal:{},pepperwort:{},plasmodium:{},princewood:{},propellant:{},propellent:{},pufferfish:{},pyrimidine:{},quercitron:{},restharrow:{},restrainer:{},ribbonfish:{},ribbonwood:{},rudderfish:{},sapphirine:{},scorzonera:{},sidewinder:{},silverbush:{},silverfish:{},silverweed:{},spiceberry:{},sticktight:{},sugarberry:{},superoxide:{},tarmacadam:{},turpentine:{},turtledove:{},velvetleaf:{},vertebrate:{},vesicatory:{},wandflower:{},watermelon:{},windowpane:{},witchgrass:{},yellowbird:{},yellowtail:{},yellowwood:{},adulterator:{},arthrospore:{},artiodactyl:{},bactericide:{},boysenberry:{},branchiopod:{},buffalofish:{},butcherbird:{},cauliflower:{},cherrystone:{},chittimwood:{},chokecherry:{},combustible:{},conspecific:{},digitigrade:{},dolphinfish:{},flameflower:{},gillyflower:{},groundberry:{},groundcover:{},heterocycle:{},honeyflower:{},insectivore:{},leatherleaf:{},leatherwood:{},lingonberry:{},liquidambar:{},loosestrife:{},muskellunge:{},plantigrade:{},platyrrhine:{},pomegranate:{},precipitant:{},prickleback:{},quicksilver:{},recombinant:{},refrigerant:{},shellflower:{},silversides:{},sleuthhound:{},swallowwort:{},unguiculate:{},waldmeister:{},archosaurian:{},distillation:{},heterocyclic:{},honeycreeper:{},instillation:{},invertebrate:{},nonsteroidal:{},placentation:{},sarsaparilla:{},serviceberry:{},squirrelfish:{},transudation:{},weatherboard:{},whortleberry:{},yellowhammer:{},branchiopodan:{},inflorescence:{},platyrrhinian:{},semiconductor:{},transactinide:{},vitrification:{},fructification:{},aa:{},ai:{},ani:{},auk:{},awn:{},bot:{},dak:{},daw:{},dew:{},doe:{},dug:{},eft:{},ern:{},ewe:{},gib:{},gnu:{},goo:{},ivy:{},jay:{},kea:{},kob:{},lac:{},lye:{},may:{},mei:{},moa:{},oca:{},ola:{},olm:{},pia:{},pug:{},teg:{},tup:{},acyl:{},agua:{},aloe:{},amyl:{},anoa:{},apar:{},aril:{},arui:{},atar:{},axil:{},barm:{},baya:{},bine:{},boll:{},bufo:{},buna:{},calx:{},cavy:{},chub:{},cleg:{},coco:{},colt:{},coot:{},corm:{},cows:{},craw:{},culm:{},cyme:{},dace:{},dalo:{},deer:{plural:"deer"},derv:{},dhak:{},dhal:{},dika:{},diol:{},disa:{},dita:{},dogy:{},doob:{},dopa:{},enol:{},erne:{},eyas:{},fern:{},fice:{},floc:{},fuji:{},gean:{},goby:{},guan:{},guar:{},guib:{},haem:{},halm:{},hart:{},heme:{},hogg:{},hops:{},hoya:{},ibex:{},ibis:{},inga:{},jird:{},jute:{},kali:{},kelp:{},kola:{},kudu:{},lily:{},lino:{},liza:{},loam:{},loir:{},lory:{},lynx:{},mako:{},mamo:{},mara:{},marl:{},merl:{},mica:{},milo:{},miro:{},mola:{},moss:{},munj:{},mutt:{},myna:{},nagi:{},napa:{},napu:{},neem:{},neon:{},olla:{},ombu:{},onyx:{},opah:{},opal:{},orca:{},oryx:{},paca:{},peat:{},peba:{},pika:{},pome:{},puku:{},puma:{},pupa:{},ragi:{},rimu:{},rudd:{},sago:{},salp:{},sang:{},sard:{},scut:{},sial:{},sika:{},sild:{},sima:{},skua:{},smew:{},sugi:{},tatu:{},teff:{},teju:{},tern:{},tipu:{},toad:{},tody:{},tolu:{},tuff:{},tung:{},urea:{},urus:{},vole:{},wasp:{},weka:{},blast:{},dinar:{},lapse:{},lurch:{},whirl:{},travel:{},capacity:{},encounter:{},conversion:{},separation:{},age:{},nip:{},now:{},halt:{},leap:{},mile:{},peak:{},peso:{},slam:{},term:{},wake:{},faint:{},scoop:{},surge:{},third:{},trick:{},bother:{},cackle:{},motion:{},chatter:{},reversal:{},elevation:{},experience:{},dab:{},pat:{},cube:{},howl:{},over:{},peep:{},span:{},cause:{},death:{},plump:{},plunk:{},poise:{},pulse:{},shame:{},spark:{},twang:{},wound:{},cipher:{},crunch:{},damage:{},fusion:{},period:{},racket:{},repeat:{},supply:{},wallow:{},wonder:{},dribble:{},failure:{},outrage:{},sparkle:{},backfire:{},campaign:{},delivery:{},increase:{},variance:{},explosion:{},correction:{},disturbance:{},translation:{},displacement:{},transposition:{},hum:{},mug:{},buzz:{},cord:{},dawn:{},fuss:{},hint:{},hiss:{},much:{},past:{},ping:{},rout:{},seek:{},tide:{},warp:{},birth:{},blend:{},crumb:{},delay:{},rupee:{},worst:{},climax:{},deluge:{},dirham:{},recoil:{},replay:{},rhythm:{},rising:{},descent:{},grumble:{},impulse:{},respite:{},scruple:{},triumph:{},addition:{},dogfight:{},eruption:{},occasion:{},progress:{},reprieve:{},shilling:{},stampede:{},accretion:{},induction:{},appearance:{},suggestion:{},circulation:{},irradiation:{},accommodation:{},precipitation:{},in:{},ebb:{},mil:{},zap:{},gush:{},honk:{},lull:{},plop:{},rave:{},ream:{},slap:{},then:{},zoom:{},fifth:{},final:{},gleam:{},reign:{},swash:{},throb:{},thump:{},tweet:{},wreck:{},wring:{},billow:{},breach:{},ending:{},fourth:{},gurgle:{},injury:{},nibble:{},parity:{},sunset:{},billion:{},history:{},instant:{},spatter:{},blackout:{},creation:{},decision:{},downhill:{},entrance:{},rational:{},trillion:{},hereafter:{},immersion:{},intrusion:{},millenary:{},remainder:{},saltation:{},adjustment:{},antecedent:{},dedication:{},deflection:{},impairment:{},limitation:{},outpouring:{},refinement:{},scattering:{},devastation:{},elaboration:{},fundamental:{},prohibition:{},retardation:{},interference:{},transmission:{},manifestation:{},scintillation:{},mi:{},kip:{},wee:{},yaw:{},bout:{},bray:{},doom:{},harm:{},haul:{},jolt:{},none:{},ooze:{},pity:{},sigh:{},surf:{},thaw:{},tour:{},alpha:{},carom:{},chunk:{},clink:{},colon:{},deuce:{},drama:{},glint:{},going:{},shtik:{},sixth:{},spurt:{},thrum:{},tinge:{},today:{},waltz:{},worth:{},bucket:{},egress:{},fathom:{},mutter:{},patter:{},picnic:{},quaver:{},ripple:{},rustle:{},shtick:{},sizzle:{},squawk:{},stride:{},tremor:{},whoosh:{},wobble:{},absence:{},allegro:{},andante:{},deficit:{},episode:{},heaving:{},raising:{},rebirth:{},roaring:{},rupture:{},screech:{},scrunch:{},seventh:{},success:{},sunrise:{},takeoff:{},trample:{},twinkle:{},cracking:{},deletion:{},incident:{},interval:{},isometry:{},overflow:{},rattling:{},skeleton:{},splatter:{},striking:{},twilight:{},upheaval:{},advantage:{},alignment:{},deflexion:{},diffusion:{},emergence:{},inflation:{},normality:{},remission:{},resultant:{},ruination:{},shakedown:{},vibration:{},yesterday:{},allegretto:{},conception:{},concoction:{},concretion:{},disruption:{},divergence:{},graduation:{},inflection:{},initiation:{},moderation:{},sprinkling:{},approaching:{},biquadratic:{},competition:{},compression:{},contraction:{},humiliation:{},permutation:{},constriction:{},ramification:{},accompaniment:{},embarrassment:{},mortification:{},rectification:{},coo:{},eve:{},gee:{},par:{},sea:{},sec:{},tot:{},won:{},yen:{},bash:{},beep:{},ding:{},dram:{},fete:{},gait:{},inch:{},lira:{},peal:{},pint:{},purr:{},rial:{},ting:{},toot:{},whiz:{},blare:{},bleat:{},brawl:{},cease:{},digit:{},dying:{},epoch:{},gravy:{},idyll:{},knell:{},metre:{},minim:{},ninth:{},plash:{},plonk:{},quake:{},quart:{},ravel:{},salvo:{},skirl:{},snore:{},spate:{},spirt:{},swish:{},tenth:{},unity:{},whack:{},whirr:{},years:{},ascent:{},bushel:{},curfew:{},drachm:{},eighth:{},enough:{},finale:{},fizzle:{},footer:{},gobble:{},jingle:{},marvel:{},myriad:{},octave:{},ravage:{},smudge:{},spritz:{},squeak:{},squeal:{},squish:{},swerve:{},tierce:{},usance:{},waxing:{},atrophy:{},banging:{},bending:{},blowout:{},centner:{},clangor:{},debacle:{},decimal:{},eclipse:{},glitter:{},kickoff:{},midterm:{},million:{},misfire:{},modulus:{},monsoon:{},ordinal:{},outflow:{},ringing:{},shimmer:{},sinking:{},smolder:{},torrent:{},twelfth:{},backwash:{},bouncing:{},downfall:{},dripping:{},drumbeat:{},eighties:{},eternity:{},exigency:{},footstep:{},furlough:{},gleaming:{},grinding:{},hardship:{},instance:{},invasion:{},majority:{},maturity:{},nineties:{},overtime:{},overture:{},pandemic:{},pounding:{},receding:{},recovery:{},rustling:{},scraping:{},sixtieth:{},smoulder:{},spoilage:{},spraying:{},tomorrow:{},touching:{},amplitude:{},ascension:{},athletics:{},avalanche:{},billionth:{},checkmate:{},clearance:{},collision:{},commotion:{},contagion:{},departure:{},fertility:{},formality:{},gestation:{},heartbeat:{},honeymoon:{},hundredth:{},interlude:{},irruption:{},lactation:{},millionth:{},multitude:{},onslaught:{},outgrowth:{},plurality:{},probation:{},pulsation:{},shrinkage:{},sixteenth:{},spreading:{},stalemate:{},throbbing:{},whistling:{},withering:{},affliction:{},alteration:{},betterment:{},dispersion:{},enervation:{},expiration:{},foreboding:{},incubation:{},incumbency:{},inevitable:{},irrational:{},jubilation:{},levitation:{},millennium:{plural:"millennia"},procession:{},repetition:{},revolution:{},sabbatical:{},solubility:{},subsidence:{},thousandth:{},undulation:{},visitation:{},accelerando:{},catastrophe:{},celebration:{},coincidence:{},consequence:{},continuance:{},deformation:{},dislocation:{},dissipation:{},expansivity:{},fluctuation:{},gravitation:{},oscillation:{},preliminary:{},punctuation:{},sufficiency:{},acceleration:{},augmentation:{},championship:{},commencement:{},conservation:{},deceleration:{},degeneration:{},encroachment:{},interlocking:{},reflectivity:{},consolidation:{},hundredweight:{},magnetisation:{},magnetization:{},regurgitation:{},sheepshearing:{},transmutation:{},conglomeration:{},materialisation:{},optic:{},patty:{},prune:{},saute:{},scalp:{},sinus:{},swill:{},bubbly:{},burgoo:{},choler:{},claret:{},cortex:{},crotch:{},drivel:{},frappe:{},hiatus:{},kosher:{},legume:{},macula:{},phlegm:{},pickle:{},stemma:{},thenar:{},tiptoe:{},adrenal:{},anatomy:{},confect:{},freckle:{},jugular:{},knuckle:{},mastoid:{},medulla:{},pudding:{},takeout:{},thyroid:{},tonsure:{},wassail:{},anterior:{},coloring:{},julienne:{},libation:{},rhomboid:{},sandwich:{},takeaway:{},appendage:{},chocolate:{},colouring:{},endocrine:{},hamstring:{},moonshine:{},permanent:{},recessive:{},turbinate:{},confection:{},hemisphere:{},ingredient:{},spatchcock:{},sweetening:{},convolution:{},pneumogastric:{},os:{},cos:{},cud:{},sup:{},caul:{},chaw:{},chin:{},chou:{},curd:{},cyst:{},fizz:{},jowl:{},mane:{},milt:{},perm:{},snot:{},sorb:{},sura:{},taco:{},booze:{},broth:{},caput:{},chili:{},cocoa:{},costa:{},cress:{},dough:{},eater:{},fanny:{},fondu:{},hyoid:{},loins:{},lolly:{},lumen:{},mamma:{},mummy:{},pasta:{},plasm:{},porgy:{},puree:{},quaff:{},quark:{},sinew:{},thigh:{},tripe:{},tummy:{},areola:{},banana:{},booger:{},bowleg:{},brunch:{},carpal:{},cervix:{},citrus:{},comfit:{},dactyl:{},dorsum:{},edible:{},flitch:{},fondue:{},fornix:{},gammon:{},herbal:{},lambda:{},malted:{},marcel:{},millet:{},monggo:{},noodle:{},paring:{},pastry:{},pelvis:{},simnel:{},spleen:{},tarsal:{},tensor:{},tipple:{},waffle:{},wonton:{},abdomen:{},adenoid:{},auricle:{},biscuit:{},brownie:{},clabber:{},criollo:{},croaker:{},cubitus:{},deltoid:{},dentine:{},dietary:{},eyeball:{},fistula:{},forearm:{},fritter:{},gherkin:{},haircut:{},headful:{},hyaloid:{},iceberg:{},isthmus:{},kneecap:{},lacteal:{},lasagna:{},lasagne:{},lozenge:{},marmite:{},midriff:{},oatmeal:{},ocellus:{},pageboy:{},paprika:{},pathway:{},pottage:{},prepuce:{},pumpkin:{},ramekin:{},ratafia:{},roulade:{},sausage:{},seltzer:{},serving:{},sidecar:{},slobber:{},sorghum:{},stirrup:{},sultana:{},teacake:{},timbale:{},toenail:{},topping:{},tostada:{},trachea:{},treacle:{},twister:{},vintage:{},abducent:{},abductor:{},afferent:{},alveolus:{},appendix:{plural:"appendices"},astragal:{},bicuspid:{},blowfish:{},blowhole:{},bouffant:{},capitate:{},chowchow:{},cobblers:{},cocktail:{},coquille:{},couscous:{},doughboy:{},doughnut:{},dumpling:{},efferent:{},eminence:{},exocrine:{},fascicle:{},flatfish:{},flatfoot:{},flummery:{},forehead:{},foreskin:{},hairline:{},honeydew:{},licorice:{},ligament:{},lollipop:{},macaroni:{},mackerel:{},marinade:{},membrane:{},monstera:{},mouthful:{},muscatel:{},pheasant:{},physique:{},potation:{},prostate:{},ramequin:{},receptor:{},sillabub:{},sinusoid:{},smoothie:{},specimen:{},streusel:{},stuffing:{},syllabub:{},teardrop:{},venation:{},windfall:{},abdominal:{},apparatus:{},blueberry:{},casserole:{},corpuscle:{},cranberry:{},demitasse:{},dentition:{},drinkable:{},drumstick:{},epiphysis:{},flageolet:{},fricassee:{},hamburger:{},labyrinth:{},lifeblood:{},lineament:{},liquorice:{},mastoidal:{},maxillary:{},navicular:{},pituitary:{},pompadour:{},provender:{},purulence:{},shellfish:{},spaghetti:{},spareribs:{},splayfoot:{},spoilable:{},sundowner:{},sweetener:{},trapezium:{},trapezoid:{},umbilical:{},ventricle:{},vestibule:{},zygomatic:{},applesauce:{},autoplasty:{},blackheart:{},breadstuff:{},cheesecake:{},comestible:{},gastronomy:{},hotchpotch:{},interstice:{},jawbreaker:{},kitambilla:{},maraschino:{},metacarpal:{},metatarsal:{},passageway:{},perishable:{},salmagundi:{},shortening:{},articulator:{},excrescence:{},grasshopper:{},griddlecake:{},intercostal:{},longanberry:{},nourishment:{},screwdriver:{},smorgasbord:{},spindlelegs:{},checkerberry:{},perspiration:{},spindleshanks:{},parasympathetic:{},ab:{},ade:{},ale:{},bap:{},bun:{},jak:{},lat:{},lox:{},pes:{},pie:{},poi:{},pud:{},pus:{},tum:{},vas:{},veg:{},anus:{},arak:{},axon:{},baba:{},bile:{},bleb:{},bleu:{},bock:{},bosc:{},choc:{},clit:{},cola:{},coxa:{},crus:{},cuke:{},duff:{},dura:{},edda:{},eggs:{},fist:{},flab:{},flan:{},fugu:{},genu:{},ghee:{},glia:{},grog:{},isaw:{},java:{},kava:{},marc:{},mayo:{},mead:{},miso:{},mons:{},naan:{},nape:{},nipa:{},oleo:{},orzo:{},ouzo:{},ovum:{},pecs:{},pita:{},pone:{},pons:{},porc:{},rete:{},rima:{},rind:{},roux:{},ruga:{},rusk:{},slaw:{},sops:{},suet:{},tofu:{},ugli:{},ulna:{},umbo:{},uvea:{},veal:{},veau:{},vena:{},vino:{},womb:{},ziti:{},zona:{},ackee:{},adobo:{},aioli:{},anjou:{},ankle:{},annon:{},aorta:{},arcus:{},aspic:{},atole:{},axone:{},babka:{},bacon:{},bagel:{},bialy:{},bigos:{},bitok:{},blanc:{},blini:{},bliny:{},boeuf:{},borsh:{},bowel:{},bursa:{},butty:{},cauda:{},cavum:{},cecum:{},celom:{},chips:{},chyle:{},cider:{},congo:{},copra:{},cornu:{},cuppa:{},cutis:{},cyder:{},cytol:{},decaf:{},donut:{},facia:{},femur:{},filum:{},flews:{},fovea:{},fries:{},gigot:{},gland:{},glans:{},gleet:{},glogg:{},glute:{},gonad:{},goody:{},grist:{},grits:{},gruel:{},gyrus:{},hilus:{},hoagy:{},hooch:{},hooks:{},hymen:{},hyson:{},ileum:{},ilium:{},incus:{},inion:{},jello:{},julep:{},kabob:{},kasha:{},kebab:{},knish:{},kumis:{},kvass:{},lansa:{},latke:{},latte:{},lichi:{},limpa:{},lymph:{},macon:{},manus:{},matzo:{},mucus:{},nacho:{},naris:{},nates:{},negus:{},offal:{},ootid:{},pekoe:{},penis:{},penne:{},perry:{},pesto:{},pilaf:{},pinky:{},pizza:{},plica:{},porta:{},pruno:{},psoas:{},pubis:{},quiff:{},raita:{},ramus:{},raphe:{},salmi:{},salsa:{},savoy:{},sebum:{},serum:{},sirup:{},skull:{},sperm:{},steak:{},sudor:{},sushi:{},taffy:{},tamal:{},tater:{},teeth:{},teres:{},tibia:{},titty:{},toddy:{},toffy:{},torso:{},torte:{},tress:{},uvula:{},vagus:{},viand:{},vodka:{},vomer:{},vulva:{},wrist:{},adnexa:{},afters:{},agnail:{},ananas:{},anlage:{},annexa:{},annona:{},antrum:{},armpit:{},arrack:{},axilla:{},baguet:{},beigel:{},biceps:{},bisque:{},blintz:{},bonbon:{},borsch:{},brazil:{},bregma:{},bulgur:{},burger:{},cachou:{},caecum:{},canape:{},canola:{},cardia:{},carina:{},carpus:{},casaba:{},catsup:{},caviar:{},chevre:{},chiasm:{},chilli:{},choana:{},coccyx:{},coelom:{},comedo:{},concha:{},confit:{},congou:{},corium:{},corpse:{},cupper:{},cuspid:{},cutlet:{},damson:{},danish:{},dermis:{},dewlap:{},dolmas:{},eclair:{},eggnog:{},eschar:{},eyelid:{},farina:{},fauces:{},fibula:{},finnan:{},flexor:{},fundus:{},gateau:{},geneva:{},giblet:{},glossa:{},gluten:{},goatee:{},gobbet:{},gonion:{},goober:{},graham:{},grappa:{},groats:{},gulyas:{},haggis:{},hairdo:{},hallah:{},hallux:{},hamate:{},haslet:{},hoagie:{},hominy:{},hommos:{},hootch:{},hotpot:{},huitre:{},hummus:{},inguen:{},intima:{},jambon:{},jugale:{},jumbal:{},karyon:{},kencur:{},kidney:{},kipper:{},kirsch:{},kishke:{},korlan:{},kummel:{},labium:{},lamina:{},lanseh:{},lanugo:{},larynx:{},lekvar:{},limbus:{},lingua:{},lobule:{},lochia:{},locule:{},lunule:{},matzoh:{},meatus:{},meninx:{},milium:{},mohawk:{},mouton:{},mucosa:{},muesli:{},muffin:{},murphy:{},mutton:{},nasion:{},nervus:{},neuron:{},nougat:{},oculus:{},omelet:{},onyxis:{},oocyte:{},oolong:{},operon:{},organs:{},paczki:{},paella:{},palate:{},paries:{},pastis:{},paunch:{},pectus:{},phyllo:{},pilaff:{},pinkie:{},pinole:{},pirogi:{},pleura:{},plexus:{},pollex:{},polony:{},posset:{},potage:{},poteen:{},potion:{},potpie:{},poulet:{},premix:{},pulque:{},purloo:{},quiche:{},rectum:{},rectus:{},repast:{},retina:{},rhaphe:{},ribier:{},rickey:{},rotgut:{},sacrum:{},salami:{},saliva:{},samosa:{},sapota:{},scampi:{},scampo:{},sclera:{},scruff:{},seckel:{},serosa:{},shandy:{},sherry:{},silage:{},skilly:{},smegma:{},soleus:{},sorbet:{},sputum:{},stapes:{},stodge:{},succus:{},sulcus:{},sundae:{},sutura:{},tahini:{},tamale:{},tarsus:{},tendon:{},testis:{},thymus:{},tidbit:{},tiffin:{},tisane:{},titbit:{},toffee:{},tonsil:{},tragus:{},troche:{},tubule:{},tunica:{},unguis:{},ureter:{},uterus:{},vagina:{},veggie:{},venula:{},venule:{},vermis:{},vesica:{},viscus:{},vitals:{},waters:{},whisky:{},wiener:{},yogurt:{},zaatar:{},zonula:{},zonule:{},zygoma:{},zygote:{},absinth:{},akvavit:{},aniseed:{},aquavit:{},arteria:{},ashcake:{},baklava:{},bannock:{},beignet:{},keen:{},rage:{},wish:{},aside:{},chafe:{},gloss:{},tense:{},whole:{},worry:{},effect:{},reject:{},riddle:{},snatch:{},speech:{},closure:{},collect:{},romance:{},flourish:{},classical:{},influence:{},substance:{},reflection:{},inclination:{},recognition:{},dot:{},nod:{},blur:{},itch:{},slur:{},solo:{},wink:{},abuse:{},acute:{},alert:{},angle:{},bluff:{},cheer:{},honor:{},humor:{},lyric:{},snarl:{},tally:{},accent:{},degree:{},detail:{},indent:{},matter:{},patent:{},rubric:{},thrill:{},abandon:{},bluster:{},concern:{},concord:{},formula:{plural:"formulae"},imprint:{},nominal:{},quality:{},reading:{},sputter:{},torture:{},wrinkle:{},contrast:{},estimate:{},harmonic:{},judgment:{},reaction:{},sanction:{},singular:{},straddle:{},construct:{},judgement:{},reflexion:{},rendering:{},universal:{},acceptance:{},discipline:{},irritation:{},regulation:{},relaxation:{},submission:{},application:{},replication:{},construction:{},introduction:{},presentation:{},cant:{},code:{},joke:{},pain:{},stab:{},trot:{},will:{},blame:{},brief:{},dodge:{},fancy:{},glide:{},grasp:{},guess:{},quote:{},scent:{},slant:{},snort:{},swoop:{},theme:{},trial:{},vocal:{},accord:{},affect:{},cancel:{},debate:{},desire:{},heroic:{},murmur:{},phrase:{},resume:{},scream:{},serial:{},tangle:{},closing:{},dissent:{},drawing:{},example:{},exhibit:{},fatigue:{},feeling:{},mention:{},partial:{},posture:{},protest:{},regress:{},telling:{},welcome:{},absolute:{},analysis:{plural:"analyses"},distress:{},pastoral:{},platform:{},temporal:{},agreement:{},attention:{},beginning:{},closeness:{},connexion:{},dimension:{},discourse:{},lightness:{},principle:{},surrender:{},assignment:{},coordinate:{},involution:{},abstraction:{},arrangement:{},conjunction:{},declaration:{},penetration:{},proposition:{},realisation:{},realization:{},condensation:{},consideration:{},no:{},cue:{},fun:{},rub:{},bias:{},gift:{},hoot:{},jazz:{},oral:{},snub:{},text:{},tune:{},urge:{},coast:{},craze:{},daily:{},debut:{},dowse:{},funny:{},logic:{},mercy:{},peace:{},rerun:{},samba:{},slang:{},taboo:{},verse:{},whine:{},words:{},aspect:{},babble:{},canker:{},choice:{},clamor:{},denial:{},device:{},esteem:{},format:{},lament:{},manual:{},menace:{},normal:{},pardon:{},regret:{},skinny:{},sorrow:{},tickle:{},twinge:{},vision:{},warmth:{},caution:{},charter:{},conceit:{},cunning:{},delight:{},dictate:{},discord:{},finance:{},harmony:{},keynote:{},knowing:{},leaning:{},lecture:{},mistake:{},musical:{},offense:{},palaver:{},preempt:{},purpose:{},pyrrhic:{},realism:{},sharing:{},texture:{},worship:{},writing:{},aspirate:{},biweekly:{},blessing:{},citation:{},despatch:{},dullness:{},feminine:{},flatness:{},geminate:{},manifest:{},personal:{},pleasure:{},politics:{},singsong:{},yielding:{},agitation:{},attrition:{},bimonthly:{},broadcast:{},confusion:{},deviation:{},disregard:{},education:{},faintness:{},heaviness:{},imitation:{},indenture:{},interview:{},isolation:{},isometric:{},minuscule:{},portrayal:{},predicate:{},provision:{},screaming:{},signature:{},spiritual:{},throwaway:{},tightness:{},accounting:{},aggression:{},assumption:{},attraction:{},commercial:{},compromise:{},confession:{},confidence:{},conformity:{},conveyance:{},detachment:{},difference:{},discretion:{},imperative:{},mellowness:{},modulation:{},tenderness:{},uneasiness:{},awkwardness:{},discernment:{},elimination:{},endorsement:{},examination:{},fabrication:{},familiarity:{},implication:{},indorsement:{},involvement:{},observation:{},obstruction:{},performance:{},requisition:{},sensitivity:{},testimonial:{},appreciation:{},articulation:{},condemnation:{},confirmation:{},deliberation:{},intervention:{},satisfaction:{},confrontation:{},decomposition:{},determination:{},reinforcement:{},understanding:{},characteristic:{},correspondence:{},sophistication:{},transformation:{},rationalisation:{},rationalization:{},dub:{},fog:{},bold:{},buoy:{},dare:{},daze:{},envy:{},gape:{},okay:{},plus:{},rasp:{},rime:{},role:{},tabu:{},yell:{},above:{},affix:{},agape:{},chord:{},croak:{},doubt:{},email:{},essay:{},folly:{},idiom:{},laugh:{},modal:{},panic:{},posit:{},rhyme:{},rider:{},rumba:{},scare:{},scorn:{},sneer:{},trill:{},truth:{},wince:{},adagio:{},binary:{},daring:{},defeat:{},dismay:{},docket:{},filing:{},flavor:{},giving:{},gospel:{},lesson:{},median:{},neuter:{},notion:{},parody:{},parole:{},plight:{},rebuff:{},rhumba:{},sample:{},shiver:{},solace:{},trance:{},unseen:{},vanity:{},vector:{},amnesty:{},anguish:{},arousal:{},bucolic:{},caption:{},catalog:{},contour:{},descant:{},disdain:{},dispute:{},fantasy:{},flavour:{},glimpse:{},insight:{},languor:{},licence:{},marking:{},overbid:{},prelude:{},probate:{},purport:{},pursuit:{},reality:{},receipt:{},recital:{},riposte:{},splurge:{},sticker:{},summons:{},wrangle:{},approval:{},buoyancy:{},converse:{},coolness:{},covenant:{},crotchet:{},devotion:{},dialogue:{},emphasis:{},esthetic:{},excision:{},fairness:{},fixation:{},forecast:{},hieratic:{},identity:{},illusion:{},integral:{},monotone:{},offering:{},paradigm:{},premiere:{},printing:{},referent:{},rescript:{},research:{},rhetoric:{},schedule:{},skimming:{},sleeping:{},speaking:{},splutter:{},streamer:{},tendency:{},topology:{},vexation:{},wildness:{},adjective:{},aesthetic:{},assurance:{},burlesque:{},catalogue:{},correlate:{},detection:{},discovery:{},dismissal:{},exclusion:{},exclusive:{},expansion:{},impromptu:{},inaugural:{},indicator:{},intensive:{},interdict:{},largeness:{},masculine:{},paragraph:{},partitive:{},pragmatic:{},prevision:{},quarterly:{},quotation:{},readiness:{},rendition:{},reverence:{},roundness:{},safeguard:{},suspicion:{},sweetness:{},thickness:{},trademark:{},antagonism:{},aspiration:{},bitterness:{},coarseness:{},collection:{},conjecture:{},deposition:{},estimation:{},excitement:{},gloominess:{},impossible:{},incitement:{},invocation:{},inwardness:{},literature:{},morphology:{},narrowness:{},nominative:{},observance:{},possessive:{},postmortem:{},preemption:{},preference:{},profession:{},profundity:{},recitation:{},redundancy:{},abnormality:{},acquisition:{},affirmation:{},affirmative:{},alternative:{},bombardment:{},commutation:{},concurrence:{},convergence:{},countenance:{},disposition:{},distinction:{},distraction:{},enlargement:{},expectation:{},fingerprint:{},indentation:{},instruction:{},nationalism:{},possibility:{},presumption:{},publication:{},spectacular:{},speculation:{},substantive:{},superlative:{},unconscious:{},unitisation:{},unitization:{},anticipation:{},apprehension:{},circumstance:{},continuation:{},coordination:{},countercheck:{},distribution:{},hieroglyphic:{},illustration:{},intimidation:{},misdirection:{},overestimate:{},precondition:{},renunciation:{},approximation:{},authorisation:{},authorization:{},certification:{},falsification:{},interrogative:{},nonconformity:{},reduplication:{},sensitiveness:{},sequestration:{},superposition:{},underestimate:{},capitalisation:{},capitalization:{},generalisation:{},generalization:{},perceptiveness:{},recapitulation:{},sensationalism:{},awe:{},bop:{},ego:{},hex:{},jot:{},lit:{},nub:{},vow:{},beta:{},brag:{},clue:{},cull:{},elan:{},epic:{},funk:{},fury:{},gibe:{},hymn:{},jibe:{},leer:{},lust:{},mood:{},oath:{},pang:{},plea:{},quip:{},rant:{},riff:{},visa:{},zeal:{},zest:{},alibi:{},badge:{},basis:{plural:"bases"},bravo:{},carol:{},chant:{},chaos:{},conga:{},delta:{},demur:{},dread:{},fable:{},flair:{},fugue:{},given:{},gloat:{},gloom:{},hunch:{},infix:{},irony:{},largo:{},least:{},libel:{},magic:{},moral:{},polka:{},reply:{},sally:{},spiel:{},spook:{},stymy:{},tango:{},usage:{},velar:{},vigil:{},whoop:{},affair:{},airing:{},ardour:{},ballot:{},bathos:{},beauty:{},bellow:{},bowing:{},curtsy:{},deceit:{},dental:{},dialog:{},gambit:{},gibber:{},grudge:{},halloo:{},insult:{},intent:{},italic:{},kowtow:{},labial:{},latest:{},manner:{},mumble:{},naming:{},outcry:{},pathos:{},piffle:{},plural:{},policy:{},praise:{},raving:{},rehash:{},revise:{},scalar:{},scroll:{},seeing:{},shriek:{},sonnet:{},stymie:{},tattle:{},theory:{},tingle:{},tumult:{},upbeat:{},urging:{},wangle:{},weekly:{},wheeze:{},yearly:{},acclaim:{},acidity:{},airmail:{},analogy:{},apology:{},barrage:{},barrier:{},bidding:{},bonding:{},buildup:{},cadence:{},cartoon:{},censure:{},clutter:{},concert:{},cruelty:{},despair:{},disgust:{},dodging:{},earmark:{},embargo:{},enquiry:{},erasure:{},eristic:{},fluency:{},gradual:{},gravity:{},initial:{},inquiry:{},lingual:{},loyalty:{},mastery:{},mimesis:{},monthly:{},numeral:{},omnibus:{},outlook:{},palatal:{},placard:{},polemic:{},posting:{},presage:{},preview:{},quibble:{},refrain:{},reissue:{},reorder:{},reprint:{},rewrite:{},roundup:{},singing:{},slander:{},sorting:{},tasting:{},tribute:{},turmoil:{},whisper:{},ablative:{},acridity:{},allegory:{},alveolar:{},ambition:{},ascender:{},audition:{},binomial:{},brandish:{},brooding:{},bundling:{},calculus:{},circular:{},clipping:{},coldness:{},courtesy:{},critique:{},daydream:{},defiance:{},delusion:{},demurrer:{},disfavor:{},disquiet:{},dynamism:{},easiness:{},equation:{},fondness:{},grasping:{},grouping:{},guidance:{},guttural:{},hornpipe:{},hysteria:{},idealism:{},intimacy:{},mistrust:{},monition:{},negation:{},nickname:{},nihilism:{},notation:{},ordinate:{},outburst:{},particle:{},passport:{},pedagogy:{},petition:{},phantasy:{},planning:{},playbook:{},proposal:{},revision:{},rhapsody:{},ridicule:{},sampling:{},serenade:{},slowness:{},sourness:{},subtitle:{},suspense:{},sympathy:{},tartness:{},teaching:{},theology:{},travesty:{},universe:{},acuteness:{},addiction:{},adoration:{},attending:{},autograph:{},constancy:{},crispness:{},cuneiform:{},deception:{},defensive:{},denseness:{},dialectic:{},dictation:{},digestion:{},diplomacy:{},disfavour:{},editorial:{},emulation:{},enactment:{},evocation:{},fecundity:{},footprint:{},formalism:{},formative:{},gradation:{},grievance:{},grumbling:{},guideline:{},immediacy:{},insurance:{},intention:{},intercept:{},invariant:{},itinerary:{},lassitude:{},majuscule:{},misgiving:{},monologue:{},morbidity:{},murmuring:{},narration:{},nutrition:{},ordinance:{},oversight:{},pictorial:{},pizzicato:{},prejudice:{},quadratic:{},quickness:{},quickstep:{},reckoning:{},reflexive:{},rejoicing:{},repulsion:{},retention:{},retrieval:{},revealing:{},saltiness:{},schooling:{},sentience:{},sulkiness:{},synthesis:{},testament:{},testimony:{},underline:{},undertone:{},accidental:{},accusative:{},adaptation:{},admiration:{},affixation:{},allurement:{},anatomical:{},antiphonal:{},asceticism:{},belittling:{},brightness:{},brilliance:{},chronology:{},classified:{},cleverness:{},clumsiness:{},cognizance:{},compliment:{},concession:{},conscience:{},conspiracy:{},contention:{},continuity:{},decoration:{},determiner:{},deterrence:{},digression:{},diminution:{},discontent:{},dissection:{},dissonance:{},divination:{},empiricism:{},enthusiasm:{},enticement:{},equivalent:{},execration:{},fortissimo:{},grogginess:{},hesitation:{},humbleness:{},hypostasis:{},hypothesis:{plural:"hypotheses"},impatience:{},infliction:{},insistence:{},instalment:{},intermezzo:{},jocularity:{},loneliness:{},neutrality:{},nomination:{},oppression:{},perfection:{},pestilence:{},philosophy:{},precaution:{},pretension:{},propensity:{},refutation:{},reputation:{},revelation:{},rumination:{},salutation:{},semiweekly:{},stigmatism:{},theatrical:{},triviality:{},underscore:{},unfairness:{},vernacular:{},vocabulary:{},whispering:{},acceptation:{},advancement:{},aggravation:{},appellative:{},benevolence:{},calculation:{},comparative:{},concordance:{},conjunctive:{},conjuration:{},correlation:{},correlative:{},countersign:{},denigration:{},designation:{},discourtesy:{},documentary:{},electricity:{},enchantment:{},engrossment:{},exclamation:{},explanation:{},exploration:{},foolishness:{},frustration:{},imperialism:{},infatuation:{},inscription:{},jactitation:{},obfuscation:{},outwardness:{},peculiarity:{},playfulness:{},presentment:{},propagation:{},provocation:{},rationalism:{},regionalism:{},repudiation:{},resignation:{},rotogravure:{},semimonthly:{},sensibility:{},seriousness:{},stipulation:{},strangeness:{},subcontract:{},supposition:{},syncopation:{},titillation:{},tranquility:{},unorthodoxy:{},unsoundness:{},valedictory:{},breakthrough:{},choreography:{},conciliation:{},constitution:{},consultation:{},counterpoint:{},covetousness:{},depreciation:{},faultfinding:{},heedlessness:{},helplessness:{},idealisation:{},idealization:{},impertinence:{},intoxication:{},irritability:{},mercifulness:{},notification:{},pacification:{},processional:{},promulgation:{},proportional:{},recollection:{},retroflexion:{},retroversion:{},significance:{},solicitation:{},spiritualism:{},stupefaction:{},supplication:{},transference:{},acculturation:{},attentiveness:{},communication:{},comprehensive:{},condescension:{},contradiction:{},demonstrative:{},determinative:{},documentation:{},hallucination:{},impersonation:{},individualism:{},interpolation:{},orchestration:{},preoccupation:{},prevarication:{},qualification:{},retentiveness:{},retroflection:{},structuralism:{},symbolisation:{},symbolization:{},versification:{},aggressiveness:{},categorisation:{},demoralisation:{},demoralization:{},farsightedness:{},predisposition:{},recommendation:{},reconstruction:{},sesquipedalian:{},simplification:{},traditionalism:{},conventionality:{},crystallization:{},personification:{},prognostication:{},characterization:{},predetermination:{},pi:{},xi:{},boo:{},bye:{},dit:{},fib:{},ire:{},ken:{},nay:{},pic:{},psi:{},pun:{},wai:{},woe:{},yea:{},blip:{},blog:{},deed:{},demo:{},epos:{},gist:{},grin:{},heed:{},idyl:{},iota:{},jive:{},moan:{},muse:{},norm:{},noun:{},nous:{},odor:{},pean:{},ploy:{},pomp:{},quiz:{},sass:{},sext:{},spam:{},sulk:{},surd:{},tale:{},trig:{},vlog:{},whim:{},yack:{},yoga:{},agony:{},alias:{},aroma:{},axiom:{},bebop:{},blues:{},bonus:{},canto:{},codex:{},creed:{},ditto:{},dogma:{},drawl:{},edict:{},ethic:{},facet:{},fever:{},frown:{},gamma:{},gamut:{},grief:{},groan:{},guilt:{},intro:{},kotow:{},macro:{},odour:{},omega:{},paean:{},pavan:{},peeve:{},prate:{},primo:{},prose:{},psalm:{},qualm:{},retro:{},rumor:{},savvy:{},scowl:{},shrug:{},skill:{},smirk:{},danger:{},push:{},refusal:{},tooling:{},trelvox:{}},verbs:{import:{},call:{},test:{},contain:{},extend:{},use:{},depend:{prep:"on"},rely:{prep:"on"},inherit:{prep:"from"},belong:{prep:"to",predicate:"mgx:partOf"},point:{prep:"to"},implement:{},override:{},export:{},define:{},declare:{},reference:{},invoke:{},wrap:{},mock:{},cover:{},document:{},describe:{},modify:{},touch:{},fix:{},break:{},introduce:{},deprecate:{},replace:{},own:{},maintain:{},review:{},merge:{},revert:{},deploy:{},run:{},execute:{},load:{},parse:{},emit:{},validate:{},log:{},throw:{},catch:{},create:{},delete:{},update:{},expose:{},consume:{},produce:{},generate:{},configure:{},install:{},publish:{},release:{},ship:{},watch:{},trigger:{},build:{},write:{},read:{},have:{},like:{},want:{},need:{},believe:{},trust:{},love:{},hate:{},fear:{},hope:{},teach:{},learn:{},drive:{},cook:{},sing:{},visit:{},care:{},grow:{},marry:{},wear:{},eat:{},sleep:{},walk:{},buy:{},sell:{},give:{},take:{},meet:{},ride:{},speak:{},duck:{}},adjectives:{legacy:{type:"subclass"},mock:{type:"subclass"},senior:{type:"subclass"},internal:{type:"subclass"},external:{type:"subclass"},public:{type:"subclass"},private:{type:"subclass"},abstract:{type:"subclass"},static:{type:"subclass"},async:{type:"subclass"},experimental:{type:"subclass"},stable:{type:"subclass"},core:{type:"subclass"},shared:{type:"subclass"},global:{type:"subclass"},local:{type:"subclass"},generated:{type:"subclass"},standalone:{type:"subclass"},primary:{type:"subclass"},secondary:{type:"subclass"},deprecated:{type:"data"},fast:{type:"data"},slow:{type:"data"},large:{type:"data"},small:{type:"data"},flaky:{type:"data"},tested:{type:"data"},documented:{type:"data"},buggy:{type:"data"},broken:{type:"data"},green:{type:"data"},deterministic:{type:"data"},pure:{type:"data"},empty:{type:"data"},stale:{type:"data"},male:{type:"data"},female:{type:"data"},young:{type:"data"},old:{type:"data"},hot:{type:"data"},cold:{type:"data"},sweet:{type:"data"},salty:{type:"data"},sharp:{type:"data"},round:{type:"data"},tall:{type:"data"},short:{type:"data"},happy:{type:"data"},sad:{type:"data"},angry:{type:"data"},afraid:{type:"data"},strong:{type:"data"},weak:{type:"data"},rich:{type:"data"},poor:{type:"data"},hard:{type:"data"},soft:{type:"data"},wild:{type:"data"},gentle:{type:"data"},colorful:{type:"data"},legitimate:{type:"data"},ranked:{type:"data"},related:{type:"data"},sacred:{type:"data"},unaffected:{type:"data"}},properNames:["tmct","Node","npm","JavaScript","TypeScript","Python","Java","Git","GitHub","GitLab","ESLint","Linux","macOS","Windows","Polycode","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]}});var Sv={};Lt(Sv,{CODE_REF_SHAPE:()=>ol,DETERMINERS:()=>mp,OF_CLASSIFIER_HEADS:()=>gp,OF_PARTITIVE_HEADS:()=>bp,QUANTIFIERS:()=>hp,classify:()=>wp,loadLexicon:()=>$n,lookupAdjective:()=>Ji,lookupNoun:()=>On,lookupProperName:()=>zr,lookupVerb:()=>Xi,numberOf:()=>Yi,predicateOf:()=>sl,readsAsIndividualName:()=>rl,thirdPerson:()=>vv,withProperNames:()=>Ev});function Yi(e){let t=String(e??"").trim().toLowerCase();return/^\d+$/.test(t)?Number(t):mN[t]??null}function vv(e){let t=String(e);return t==="have"?"has":/[^aeiou]y$/.test(t)?`${t.slice(0,-1)}ies`:/(s|x|z|ch|sh)$/.test(t)?`${t}es`:`${t}s`}function sl(e,t=$v){if(e.predicate)return e.predicate;let n=e.prep?e.prep[0].toUpperCase()+e.prep.slice(1):"";return`${t}${vv(e.lemma)}${n}`}function xv(e){let t=String(e),n=[t];return t.length>4&&/[a-z]ies$/.test(t)&&n.push(`${t.slice(0,-3)}y`),/(ses|xes|zes|ches|shes)$/.test(t)&&n.push(t.slice(0,-2)),/[a-z]s$/.test(t)&&!/ss$/.test(t)&&n.push(t.slice(0,-1)),t==="has"&&n.push("have"),n}function yv(e,t={}){for(let[n,s]of Object.entries(t.nouns||{})){let o={lemma:n,...s||{}};if(o.property&&!hN.has(o.property))throw new Error(`lexicon noun "${n}": property must be "data" or "object", got ${JSON.stringify(o.property)}`);e.nouns.set(n,o),o.plural&&e.nounPlurals.set(o.plural,n)}for(let[n,s]of Object.entries(t.verbs||{}))e.verbs.set(n,{lemma:n,...s||{}});for(let[n,s]of Object.entries(t.adjectives||{})){let o={lemma:n,...s||{}};if(!gN.has(o.type))throw new Error(`lexicon adjective "${n}": type must be "subclass" or "data", got ${JSON.stringify(o.type)}`);e.adjectives.set(n,o)}for(let n of t.properNames||[])e.properNames.set(String(n).toLowerCase(),String(n))}function $n(e,t=$v){if(!e&&pp.has(t))return pp.get(t);let n=wv,s={nouns:new Map,nounPlurals:new Map,verbs:new Map,adjectives:new Map,properNames:new Map,ns:t};return yv(s,n),e?(yv(s,e),s):(pp.set(t,s),s)}function Ev(e,t){let n=new Map(e.properNames);for(let s of t)n.set(String(s).toLowerCase(),String(s));return{...e,properNames:n}}function On(e,t,n={}){return bN(e,t,n)[0]??null}function bN(e,t,n={}){let s=String(t??"").toLowerCase(),o=e.nouns.get(s),r=e.nounPlurals.get(s),i=[],a=new Set,c=l=>{l&&!a.has(l.lemma)&&(a.add(l.lemma),i.push(l))};if(r){let l=e.nouns.get(r)??null;return n.singularOnly&&o?(c(o),c(l)):(c(l),c(o)),i}for(let l of xv(s))c(e.nouns.get(l));return i}function Xi(e,t){return wN(e,t)[0]??null}function wN(e,t){let n=String(t??"").toLowerCase(),s=[],o=new Set;for(let r of xv(n)){let i=e.verbs.get(r);i&&!o.has(i.lemma)&&(o.add(i.lemma),s.push(i))}return s}function Ji(e,t){return e.adjectives.get(String(t??"").toLowerCase())??null}function zr(e,t){return e.properNames.get(String(t??"").toLowerCase())??null}function rl(e,t){let n=String(e??"");if(!n)return!1;if(zr(t,n)||ol.test(n)||/^[a-z][\w]*(?:-[\w]+)+$/i.test(n)||/^[A-Z]/.test(n))return!0;let s=On(t,n);return s?s.lemma.toLowerCase()!==n.toLowerCase():!0}function wp(e,t=$n()){let n=String(e??"").trim();if(!n)return null;let s=n.toLowerCase();if(mp[s])return{pos:"determiner",type:mp[s]};if(hp[s])return{pos:"quantifier",type:hp[s]};let o=Yi(s);if(o!=null)return{pos:"number",type:"cardinal",value:o};let r=zr(t,n);if(r)return{pos:"properName",type:"individual",canonical:r};let i=On(t,s);if(i)return i.property?{pos:"noun",type:`${i.property}-property`,lemma:i.lemma,property:i.property}:{pos:"noun",type:"class",lemma:i.lemma};let a=Xi(t,s);if(a)return{pos:"verb",type:"objectProperty",lemma:a.lemma,predicate:sl(a,t.ns),...a.prep?{prep:a.prep}:{}};let c=Ji(t,s);return c?{pos:"adjective",type:c.type,lemma:c.lemma}:null}var $v,mp,hp,gp,bp,mN,hN,gN,pp,ol,cs=M(()=>{bv();$v="tmct:",mp=Object.freeze({every:"universal",a:"indefinite",an:"indefinite",the:"definite",no:"negative"}),hp=Object.freeze({"at least":"owl:minCardinality","at most":"owl:maxCardinality",exactly:"owl:cardinality"}),gp=Object.freeze(new Set(["type","kind","sort","form","class","variety","species","breed","genus"])),bp=Object.freeze(new Set(["body","mass","group","collection","set","series","number","amount","piece","part","lot","pair","bunch","pile"])),mN=Object.freeze({one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10});hN=new Set(["data","object"]),gN=new Set(["subclass","data"]);pp=new Map;ol=/[./\\#:@]/});var _V,TV,AV,yN,CV,IV,OV,jv=M(()=>{Jn();De();_V=Object.freeze({class:"Class",module:"Module",function:"Function",method:"Method",attribute:"Attribute",variable:"GlobalVariable",constant:"GlobalVariable",commit:"Commit"}),TV=Object.freeze({Class:["class","classes"],Module:["module","modules"],Function:["function","functions"],Method:["method","methods"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"]}),AV=Object.freeze({Class:[e=>`which classes inherit from ${e}`,e=>`what does ${e} contain`,e=>`where is ${e} defined`],Module:[e=>`what does ${e} import`,e=>`which modules import ${e}`,e=>`where is ${e} defined`],Function:[e=>`what calls ${e}`,e=>`what does ${e} call`,e=>`where is ${e} defined`],Method:[e=>`which class contains ${e}`,e=>`what calls ${e}`,e=>`where is ${e} defined`],Attribute:[e=>`which class contains ${e}`,e=>`where is ${e} defined`],GlobalVariable:[e=>`where is ${e} defined`,e=>`where is ${e} mentioned`],Commit:[e=>`what did commit ${e} touch`,e=>`when did ${e} change`]}),yN=Object.freeze({import:"imports",imports:"imports",importing:"imports",imported:"imports",call:"calls",calls:"calls",calling:"calls",called:"calls",invoke:"calls",invokes:"calls",invoking:"calls",contain:"contains",contains:"contains",containing:"contains",containment:"contains",member:"contains",members:"contains",inherit:"inherits",inherits:"inherits",inheriting:"inherits",inheritance:"inherits",extend:"inherits",extends:"inherits",extending:"inherits",subclass:"inherits",subclasses:"inherits",subclassing:"inherits",test:"tests",tests:"tests",testing:"tests",tested:"tests",coverage:"tests",define:"defines",defines:"defines",defining:"defines",defined:"defines",definition:"defines",definitions:"defines",declaration:"defines",touch:"touches",touches:"touches",touching:"touches",touched:"touches",cochange:"cochange","co-change":"cochange","change-coupling":"cochange",coupled:"cochange",export:"reexports",exports:"reexports",exporting:"reexports",exported:"reexports",reexport:"reexports",reexports:"reexports",reexporting:"reexports","re-export":"reexports","re-exports":"reexports","re-exporting":"reexports",serve:"serves",serves:"serves",serving:"serves",served:"serves",denote:"denotes",denotes:"denotes",denoting:"denotes",denoted:"denotes"}),CV=Object.freeze({imports:["imports"],calls:["calls","callsSymbol"],contains:["contains"],inherits:["inherits"],tests:["tests"],defines:["defines"],touches:["touches","touchesSymbol"],cochange:["cochange"],reexports:["reexports"],serves:["serves"],denotes:["denotes"]}),IV=Object.freeze({imports:{verb:"imports",edgeNoun:"import"},calls:{verb:"calls",edgeNoun:"call"},contains:{verb:"contains",edgeNoun:"containment"},inherits:{verb:"inherits from",edgeNoun:"inheritance"},tests:{verb:"tests",edgeNoun:"test"},defines:{verb:"defines",edgeNoun:"definition"},touches:{verb:"touches",edgeNoun:"touch"},cochange:{verb:"changes together with",edgeNoun:"change-coupling"},reexports:{verb:"re-exports",edgeNoun:"re-export"},serves:{verb:"serves",edgeNoun:"service"},denotes:{verb:"denotes",edgeNoun:"denotation"}}),OV=Object.freeze({imports:[{side:"obj",make:e=>`which modules import ${e}`},{side:"subj",make:e=>`what does ${e} import`}],calls:[{side:"obj",make:e=>`what calls ${e}`},{side:"subj",make:e=>`what does ${e} call`}],contains:[{side:"subj",make:e=>`what does ${e} contain`},{side:"obj",make:e=>`which class contains ${e}`}],inherits:[{side:"obj",make:e=>`which classes inherit from ${e}`},{side:"subj",make:e=>`where is ${e} defined`}],tests:[{side:"obj",make:e=>`what tests ${e}`},{side:"obj",make:e=>`where is ${e} defined`}],defines:[{side:"obj",make:e=>`where is ${e} defined`},{side:"subj",make:e=>`what does ${e} contain`}],touches:[{side:"obj",make:e=>`when did ${e} change`},{side:"subj",make:e=>`what did commit ${e} touch`}],cochange:[{side:"obj",make:e=>`where is ${e} defined`},{side:"subj",make:e=>`which modules import ${e}`}],reexports:[{side:"subj",make:e=>`what does ${e} export`},{side:"obj",make:e=>`where is ${e} defined`}],serves:[{side:"subj",make:e=>`what does ${e} serve`},{side:"obj",make:e=>`what serves ${e}`}],denotes:[{side:"subj",make:e=>`what does ${e} denote`},{side:"obj",make:e=>`what denotes ${e}`}]})});function Qi(e){if(!e||typeof e!="object")return!1;for(let t of["term","title","text","summary","url"])if(typeof e[t]!="string"||!e[t])return!1;if(!Number.isInteger(e.revid)||e.revid<=0)return!1;for(let t of["isa","source","licence"])if(e[t]!==void 0&&(typeof e[t]!="string"||!e[t]))return!1;return!0}function al(e,t){let n=String(e??"").split(/(?<=[.!?])\s+/),s="";for(let o of n){let r=s?`${s} ${o}`:o;if(r.length>t)break;s=r}return s||String(e??"").slice(0,t)}function vN(e){let t=e,n;do n=t,t=t.replace(/\s*\([^()]*\)/g,"");while(t!==n);return t}function Rv(e,t){let n=On(t,e);return n?q(n.lemma):e}function _v(e,t){let n=vN(String(e??"")).match($N);if(!n)return null;let s=!n[1],o=[];for(let u of n[2].trim().split(/\s+/))if(xN.has(u)||(o.push(u),o.length>=6))break;let r=o;for(let u=r.indexOf("of");u>0;u=r.indexOf("of")){let d=r[u-1]?.split("-").pop(),p=d&&Rv(d,t);if(p&&(SN.has(p)||jN.has(p))){r=r.slice(u+1);continue}r=r.slice(0,u);break}for(;r.length&&EN.has(r[0]);)r=r.slice(1);if(!r.length)return null;let i=r[r.length-1].split("-").pop();if(!i)return null;let a=Rv(i,t);if(kv.has(i)||kv.has(a))return null;let c=On(t,i);if(!c)return null;let l=q(c.lemma);return s&&(!/s$/.test(i)||q(i)===l)?null:l}var il,$N,xN,kv,EN,SN,jN,Ur=M(()=>{it();cs();jv();il=400;$N=/^[A-Z][^.!?]*? (?:is|are) (?:(a|an|the) )?([a-z][a-z -]{1,60})/;xN=new Set(["that","which","where","who","whose","whom","when","used","found","made","with","in","on","for","from","by","to","and","or"]),kv=new Set(["type","kind","sort","form","class","variety","group","part","piece","member","way","term","name","word","thing","example","family","genus","species","unit","series","set","list","number","amount","body","mass"]),EN=new Set(["a","an","the"]),SN=new Set(["type","kind","sort","form","class","variety","species","breed","genus","group","part","parts","piece","bunch","bit","name","set","way","unit","family","ability","color","series","mammal","practice","list","amount","mass","reworking","blockage","goddess","aura","development","consisting","announcement","messengers","subset","carrying","photograph","adding","use","science","songbird","symptom","accumulation","number","suborder","falling","management","evaluation","superorder","activity","interlacing","introduction"]),jN=new Set(["either","one","each","both","any"])});var cl,ll=M(()=>{cl=()=>{throw new Error("gunzipSync unavailable in a browser bundle")}});var kN,HV,Tv=M(()=>{Wo();ll();co();Je();Ur();kN={},HV=ne(ye(qt(kN.url)),"..","..","..")});function _N(e){if(!e||typeof e!="object")return!1;for(let t of["subject","predicate","object","provenance"])if(typeof e[t]!="string"||!e[t])return!1;return RN.includes(e.predicate)}function Av(e){return Qi(e)?e.facts===void 0?!0:Array.isArray(e.facts)&&e.facts.length>0&&e.facts.every(_N):!1}function Zi(e,t){return`research:${e}:${q(t)}`}function ul(e){if(!e||typeof e.name!="string"||!e.name||typeof e.create!="function")throw new Error("registerResearchSource: expected { name, create(options) }");TN.set(e.name,{name:e.name,create:e.create})}var RN,TN,XV,JV,Br=M(()=>{it();Ur();RN=Object.freeze(["rdf:type","rdfs:subClassOf","mgx:partOf","mgx:hasA","mgx:usedFor","mgx:capableOf","mgx:atLocation","mgx:causes","mgx:madeOf","mgx:createdBy","mgx:locatedNear","mgx:hasProperty"]);TN=new Map;XV=Object.freeze(["wikipedia","wikidata","simple-wikipedia","wiktionary","dbpedia"]),JV=Object.freeze({wikipedia:"simple-wikipedia",wikidata:"wikidata","simple-wikipedia":"simple-wikipedia",wiktionary:"wiktionary",dbpedia:"dbpedia-lookup"})});function ea({fetchImpl:e,timeoutMs:t=4e3,minIntervalMs:n=2e3,retryAfterFloorMs:s=5e3,userAgent:o,waitForSlot:r=!1,validators:i=null}={}){let a=e??((...v)=>globalThis.fetch(...v)),c=new Map,l=0,u=0,d=!1,p=()=>{if(!o)return null;let v={"Api-User-Agent":o};return typeof document>"u"&&(v["User-Agent"]=o),v};function f(v){let S=Number(v)*1e3;u=Date.now()+Math.max(S||0,s)}function m(v){let S=i?.get(v);if(!S)return null;let C={};return S.etag&&(C["If-None-Match"]=S.etag),S.lastModified&&(C["If-Modified-Since"]=S.lastModified),Object.keys(C).length?C:null}function h(v,S){if(!i)return;let C=S.headers?.get?.("etag")??"",x=S.headers?.get?.("last-modified")??"";if(!C&&!x)return;let R=i.get(v)??{};i.set(v,{etag:C||R.etag||"",lastModified:x||R.lastModified||""})}async function g(v,{asJson:S}){let C=typeof AbortController=="function"?new AbortController:null,x=C?setTimeout(()=>C.abort(),t):null;try{let R={};C&&(R.signal=C.signal);let w={...p()??{},...m(v)??{}};Object.keys(w).length&&(R.headers=w);let T=await a(v,R);if(T.status===429)return f(T.headers?.get?.("retry-after")),null;if(T.status===304)return i?{notModified:!0}:null;if(!T.ok)return null;if(h(v,T),S){let I=await T.json();return I?.error?.code==="maxlag"?(f(T.headers?.get?.("retry-after")),null):I}return await T.text()}catch{return null}finally{x!==null&&clearTimeout(x)}}async function b(v){return g(v,{asJson:!0})}async function y(v){return g(v,{asJson:!1})}let $=()=>Math.max(u,l+n);async function E(){for(;;){let v=Date.now();if(!d&&v>=$())return l=v,d=!0,!0;if(!r)return!1;await new Promise(S=>setTimeout(S,Math.max($()-v,25)))}}async function _(v,S,{remember:C=!0}={}){if(c.has(v))return c.get(v);if(!await E())return null;let x=null;try{x=await S()}catch{x=null}finally{d=!1}return C&&c.set(v,x),x}return{fetchJson:b,fetchText:y,cachedFetch:_}}var ta=M(()=>{});function NN({fetchImpl:e,origin:t=AN,timeoutMs:n=4e3,minIntervalMs:s=2e3,lexicon:o=null,userAgent:r=ON,waitForSlot:i=!1,sourceName:a=IN}={}){let c=ea({fetchImpl:e,timeoutMs:n,minIntervalMs:s,userAgent:r,waitForSlot:i});function l(p,f){let m=Array.isArray(f?.[1])?f[1]:[];for(let h of m){let g=q(h);if(g===p||g.startsWith(p))return String(h)}return null}async function u(p,f){let m=await c.fetchJson(`${t}/api/rest_v1/page/summary/${encodeURIComponent(f.replace(/ /g,"_"))}`);if(!m)return null;let h=String(m.extract??""),g=Number(m.revision),b={term:p,title:String(m.title??f),text:h,summary:al(h,il),url:String(m.content_urls?.desktop?.page??`${t}/wiki/${encodeURIComponent(f.replace(/ /g,"_"))}`),revid:g},y=o;if(!y)try{y=$n()}catch{y=null}let $=y?_v(h,y):null;return $&&(b.isa=$),Qi(b)?b:null}async function d(p){let f=await c.fetchJson(`${t}/w/api.php?action=opensearch&format=json&origin=*&maxlag=${5}&search=${encodeURIComponent(p)}&limit=3`),m=f?l(p,f):null;return m?u(p,m):null}return{name:a,origin:t,provenanceTag(p){return Zi(a,p)},async lookup(p){let f=String(p??"");return f?c.cachedFetch(f,()=>d(f)):null},async pageByTitle(p){let f=String(p??"").trim();return f?c.cachedFetch(`title\0${q(f)}`,()=>u(q(f),f)):null},async linkedTitles(p,{limit:f=25}={}){let m=String(p??"").trim();if(!m)return null;let h=await c.cachedFetch(`links\0${q(m)}`,async()=>{let b=(await c.fetchJson(`${t}/w/api.php?action=parse&format=json&formatversion=2&origin=*&maxlag=${5}&prop=links&redirects=1&page=${encodeURIComponent(m)}&section=0`))?.parse?.links;if(!Array.isArray(b))return null;let y=new Set,$=[];for(let E of b){if(!E||E.ns!==0||E.exists===!1)continue;let _=String(E.title??E["*"]??"").trim(),v=q(_);!_||!v||y.has(v)||(y.add(v),$.push(_))}return $});return Array.isArray(h)?h.slice(0,Math.max(0,f)):null}}}function LN(e={}){return NN({origin:CN,sourceName:Iv,waitForSlot:!0,...e})}var AN,CN,IN,Iv,ON,Ov=M(()=>{it();cs();Ur();Br();ta();AN="https://en.wikipedia.org",CN="https://simple.wikipedia.org",IN="wikipedia-live",Iv="simple-wikipedia",ON="the-mechanical-code-talker (+https://tmct.polycode.co.uk/)";ul({name:Iv,create:LN})});function GN(e,t){let n=Array.isArray(t?.search)?t.search:[],s=null;for(let o of n){let r=String(o?.id??"");if(!Lv.test(r))continue;let i=q(o?.label??"");if(i===e)return r;s===null&&i.startsWith(e)&&(s=r)}return s}function VN(e){let t=[];for(let[n,s]of Object.entries(zN)){let o=e?.claims?.[n];if(!Array.isArray(o))continue;let r=0;for(let i of o){if(t.length>=WN)return t;if(r>=BN)break;let a=i?.mainsnak;if(a?.snaktype!=="value")continue;let c=String(a?.datavalue?.value?.id??"");Lv.test(c)&&(t.push({property:n,predicate:s,id:c}),r+=1)}}return t}function HN(e,t,n){for(let s of UN)for(let o of e){if(o.property!==s)continue;let r=t.get(o.id);if(r&&r!==n)return r}return null}function qN({fetchImpl:e,origin:t=PN,timeoutMs:n=4e3,minIntervalMs:s=2e3,userAgent:o=DN,waitForSlot:r=!1,sourceName:i=Nv}={}){let a=ea({fetchImpl:e,timeoutMs:n,minIntervalMs:s,userAgent:o,waitForSlot:r}),c=d=>`${t}/w/api.php?${new URLSearchParams({format:"json",origin:"*",maxlag:String(5),...d})}`;async function l(d){let p=new Map;if(!d.length)return p;let f=await a.fetchJson(c({action:"wbgetentities",languages:"en",props:"labels",ids:d.join("|")}));for(let[m,h]of Object.entries(f?.entities??{})){let g=q(h?.labels?.en?.value??"");g&&p.set(m,g)}return p}async function u(d){let p=await a.fetchJson(c({action:"wbsearchentities",language:"en",uselang:"en",type:"item",limit:"5",search:d})),f=p?GN(d,p):null;if(!f)return null;let h=(await a.fetchJson(c({action:"wbgetentities",languages:"en",props:"labels|descriptions|claims|info",ids:f})))?.entities?.[f];if(!h)return null;let g=VN(h),b=await l(g.map(C=>C.id)),y=Zi(i,d),$=[],E=new Set;for(let C of g){let x=b.get(C.id);!x||x===d||E.has(`${C.predicate}\0${x}`)||(E.add(`${C.predicate}\0${x}`),$.push({subject:d,predicate:C.predicate,object:x,provenance:y}))}let _=String(h.descriptions?.en?.value??""),v={term:d,title:String(h.labels?.en?.value??""),text:_,summary:al(_,il),url:`${t}/wiki/${f}`,revid:Number(h.lastrevid),source:MN,licence:FN},S=HN(g,b,d);return S&&(v.isa=S),$.length&&(v.facts=$),Av(v)?v:null}return{name:i,origin:t,provenanceTag(d){return Zi(i,d)},async lookup(d){let p=q(d??"");return p?a.cachedFetch(p,()=>u(p)):null}}}function KN(e={}){return qN({waitForSlot:!0,...e})}var PN,Nv,MN,FN,DN,zN,UN,BN,WN,Lv,Pv=M(()=>{it();Ur();Br();ta();PN="https://www.wikidata.org",Nv="wikidata",MN="Wikidata",FN="CC0 1.0",DN="the-mechanical-code-talker (+https://tmct.polycode.co.uk/)",zN=Object.freeze({P31:"rdf:type",P279:"rdfs:subClassOf",P361:"mgx:partOf",P527:"mgx:hasA",P186:"mgx:madeOf",P366:"mgx:usedFor",P276:"mgx:atLocation",P1542:"mgx:causes",P170:"mgx:createdBy",P2670:"mgx:hasA"}),UN=["P279","P31"],BN=3,WN=12,Lv=/^Q[1-9][0-9]*$/;ul({name:Nv,create:KN})});var YN,XN,bH,yp=M(()=>{it();cs();gr();Br();YN=Object.freeze({fanoutLimit:5,maxDepth:1,maxTopics:12,minIntervalMs:2e3,source:"wikipedia"}),XN=["this","is","about","the"],bH=XN.length});var Mv=M(()=>{Pt();Je()});var $p,pl,na=M(()=>{$p=new Set(["person","place","object","event","time","quantity","organization","group","animal","plant","furniture","vehicle","insect","emotion","metal","liquid","weather","planet","jewelry","cutlery","government","material","artifact","location","structure","food","drink","clothing","body","language","mind","family","meal","season","number","entity","abstraction","physical_entity","attribute","state","act","communication","cognition","measure","unit"]),pl=new Set([...$p,"property","concept","idea","content"])});var Fv=M(()=>{it();ip();na();mi();Dn()});var Dv=M(()=>{it()});var ml=M(()=>{kn();pr()});var zv=M(()=>{it()});var JN,Uv,Bv,Wv,VH,Gv=M(()=>{zv();ta();JN=250,Uv=Object.freeze([{id:"wikimedia-featured",name:"Wikimedia featured feed",kind:"contemporary",format:"wikimedia-feed",url:"https://api.wikimedia.org/feed/v1/wikipedia/en/featured",homepage:"https://www.wikipedia.org/",licence:"CC BY-SA 4.0",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!0},{id:"hacker-news",name:"Hacker News",kind:"contemporary",format:"hn",url:"https://hacker-news.firebaseio.com/v0",homepage:"https://news.ycombinator.com/",licence:"user-submitted, discussion linked",browserVerified:"2026-08-08",minIntervalMs:JN,enabledByDefault:!0},{id:"usgs-quakes",name:"USGS earthquakes",kind:"contemporary",format:"usgs",url:"https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson",homepage:"https://earthquake.usgs.gov/",licence:"US public domain",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!0},{id:"nyt-world",name:"NYT World News",kind:"contemporary",format:"rss",url:"https://rss.nytimes.com/services/xml/rss/nyt/World.xml",homepage:"https://www.nytimes.com/section/world",licence:"personal use with attribution",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!0},{id:"wikinews-published",name:"Wikinews",kind:"contemporary",format:"mediawiki",url:"https://en.wikinews.org/w/api.php",homepage:"https://en.wikinews.org/",licence:"CC BY 2.5",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!0},{id:"simple-wikipedia",name:"Simple English Wikipedia",kind:"kb",format:"wikipedia-summary",url:"https://simple.wikipedia.org",homepage:"https://simple.wikipedia.org/",licence:"CC BY-SA 4.0",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!0},{id:"wikidata",name:"Wikidata",kind:"kb",format:"wikidata",url:"https://www.wikidata.org",homepage:"https://www.wikidata.org/",licence:"CC0 1.0",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!0},{id:"wiktionary",name:"Wiktionary",kind:"kb",format:"wiktionary",url:"https://en.wiktionary.org",homepage:"https://en.wiktionary.org/",licence:"CC BY-SA 3.0",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!0},{id:"dbpedia-lookup",name:"DBpedia Lookup",kind:"kb",format:"dbpedia-lookup",url:"https://lookup.dbpedia.org",homepage:"https://www.dbpedia.org/",licence:"CC BY-SA 3.0",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!1},{id:"english-wikipedia",name:"English Wikipedia",kind:"kb",format:"wikipedia-summary",url:"https://en.wikipedia.org",homepage:"https://en.wikipedia.org/",licence:"CC BY-SA 4.0",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!1}]),Bv=Object.freeze(["wikimedia-featured","hacker-news","usgs-quakes","nyt-world","wikinews-published"]),Wv=Object.freeze(["simple-wikipedia","wikidata","wiktionary"]),VH=new Map(Uv.map(e=>[e.id,e]))});var kt,qH,KH,YH,XH,JH,QH,ZH,eq,tq,nq,sq,oq,rq,iq,aq,cq,lq,uq,dq,vp=M(()=>{kt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},qH=kt("createRequire"),KH=kt("readFileSync"),YH=kt("access"),XH=kt("readFile"),JH=kt("writeFile"),QH=kt("appendFile"),ZH=kt("mkdir"),eq=kt("mkdtemp"),tq=kt("rename"),nq=kt("unlink"),sq=kt("rm"),oq=kt("stat"),rq=kt("copyFile"),iq=kt("readdir"),aq=kt("createReadStream"),cq=kt("createWriteStream"),lq=kt("randomBytes"),uq=kt("spawnSync"),dq=kt("createInterface")});var Vv=M(()=>{});var Hv=M(()=>{Pt();vp();Je();sa();el();fp();qe();Kt();Vv();it();nl();cs()});var aK,cK,lK,uK,Ep=M(()=>{it();Fv();Dv();Ot();cs();ml();Dn();Gv();ta();Br();Hv();aK=Object.freeze({sources:Bv,kbSources:Wv,extraSources:Object.freeze([]),pollMinutes:15,enrichMinutes:10,enrichTermsPerCycle:3,negativeCacheTtlHours:24,syllogismsPerIngest:12,itemCap:30,newsFactCap:4e3,feedTop:3,windowHours:48,minIntervalMs:0}),cK=6*36e5,lK=Object.freeze({"simple-wikipedia":"simple-wikipedia",wikidata:"wikidata",wiktionary:"wiktionary","dbpedia-lookup":"dbpedia"}),uK=ws.teach});var Sp=M(()=>{it()});var sL,xK,qv=M(()=>{Wo();ll();co();Je();Sp();it();sL={},xK=ne(ye(qt(sL.url)),"..","..","..")});var SK,jK,kK,Kv=M(()=>{SK=Object.freeze(["task","autoFeedback","alloFeedback","turnManagement","timeManagement","discourseStructuring","ownCommunicationManagement","partnerCommunicationManagement","socialObligationsManagement","contactManagement"]),jK=Object.freeze({propositionalQuestion:Object.freeze({dimension:"task",gloss:"a yes/no question about whether a proposition holds ('does X import Y?')"}),checkQuestion:Object.freeze({dimension:"task",gloss:"a yes/no question whose asker already expects the answer yes ('..., right?')"}),setQuestion:Object.freeze({dimension:"task",gloss:"a wh-question asking for the members of a set ('what does X import?')"}),choiceQuestion:Object.freeze({dimension:"task",gloss:"a question asking which of the listed alternatives holds ('is X a module or a class?')"}),inform:Object.freeze({dimension:"task",gloss:"a declarative telling the addressee something (a teach turn; also tmct explaining its own function)"}),answer:Object.freeze({dimension:"task",gloss:"an inform that discharges a question just asked (an answer grounded in the graph)"}),confirm:Object.freeze({dimension:"task",gloss:"an answer 'yes' to a check question"}),disconfirm:Object.freeze({dimension:"task",gloss:"an answer 'no' to a check question"}),agreement:Object.freeze({dimension:"task",gloss:"an inform stating that the speaker holds what the addressee just stated to be true"}),disagreement:Object.freeze({dimension:"task",gloss:"an inform stating that the speaker holds what the addressee just stated to be false"}),correction:Object.freeze({dimension:"task",gloss:"a disagreement that also supplies the replacement ('no, I meant Y')"}),request:Object.freeze({dimension:"task",gloss:"asks the addressee to perform an action ('solve it' \u2014 a goal turn)"}),instruct:Object.freeze({dimension:"task",gloss:"a request the addressee is expected to carry out without negotiation (a bare imperative)"}),suggestion:Object.freeze({dimension:"task",gloss:"puts an action forward as advisable without claiming authority over the addressee"}),offer:Object.freeze({dimension:"task",gloss:"commits the speaker to an action, conditional on the addressee wanting it"}),autoPositive:Object.freeze({dimension:"autoFeedback",gloss:"the sender reports its own processing of the previous turn succeeded (an acknowledgement)"}),autoNegative:Object.freeze({dimension:"autoFeedback",gloss:"the sender reports its own processing of the previous turn failed \u2014 tmct's honest miss"}),initialGreeting:Object.freeze({dimension:"socialObligationsManagement",gloss:"opens an exchange of greetings ('hi')"}),returnGreeting:Object.freeze({dimension:"socialObligationsManagement",gloss:"answers a greeting with a greeting"}),thanking:Object.freeze({dimension:"socialObligationsManagement",gloss:"expresses gratitude for something the addressee did"}),apology:Object.freeze({dimension:"socialObligationsManagement",gloss:"expresses regret for something the speaker did"})}),kK=Object.freeze({teach:"inform","ask-set":"setQuestion","ask-propositional":"propositionalQuestion","ask-choice":"choiceQuestion",goal:"request",imperative:"instruct","honest-miss":"autoNegative",greeting:"initialGreeting",thanks:"thanking",help:"inform","game-answer":"answer","game-inform":"inform"})});var IK,rL,iL,Yv,OK,NK,LK,PK,MK,Xv=M(()=>{kn();ml();IK=Object.freeze({inline:"inline",enumerated:"enumerated"}),rL=new Set(["in","on","at","for","with","from","of","into","onto"]),iL=new Set(["you","i","it","he","she","they","we","there","someone","something","one","him","her","them","who","himself","herself","itself","themselves","myself","yourself"]),Yv=new Set([...rL,"to","behind","before","near","next","along","alongside","under","over","between","among","during","without","about","by","as","like","that","if","when","while","being","because","since","until","so","and","but","or","immediately","likely","usually","normally","currently","is","are","was","were","do","does","did","has","have","had","will","would","could","should","might","must","can"]),OK=new Set([...Yv,"be","been"]),NK=new RegExp("^(?:in|at|on|from|by|with|for|of|to|off)\\s+(?:(?:what|which)\\s+[a-z][\\w'-]*|where|when|why|how|who)\\s+(?:is|are|was|were|do|does|did|can|could|should|would|will|has|have|might|must)\\s+(.+?)[?.!]*$","i"),LK=new RegExp("^(.*?)\\b(?:what|who|which|where|when|why|how)\\s+(?:i|you|he|she|it|we|they)?\\s*(?:is|are|was|were|do|does|did|can|could|should|would|will|has|have|might|must)\\b","i"),PK=Object.freeze([{family:"AtLocation",predicates:Object.freeze(["mgx:atLocation","mgx:locatedNear"]),cue:/\b(where|located|location)\b/i},{family:"IsA/Synonym/HasProperty",predicates:Object.freeze(["rdfs:subClassOf","mgx:synonym","mgx:hasProperty"]),cue:/\b(kind of|type of|another word for|same as|synonym)\b/i},{family:"HasPrerequisite/HasSubevent",predicates:Object.freeze(["mgx:hasPrerequisite","mgx:hasSubevent","mgx:hasFirstSubevent","mgx:hasLastSubevent"]),cue:/\b(before|after|first|next|then|once you|in order to)\b/i},{family:"Desires/MotivatedByGoal",predicates:Object.freeze(["mgx:desires","mgx:motivatedByGoal","mgx:causesDesire"]),cue:/\b(want\w*|desire\w*|motivat\w*)\b/i},{family:"Causes",predicates:Object.freeze(["mgx:causes","mgx:causesDesire"]),cue:/\b(cause\w*|result(?:s|ed)? in|leads? to|led to)\b/i},{family:"PartOf/HasA/MadeOf",predicates:Object.freeze(["mgx:partOf","mgx:hasA","mgx:madeOf"]),cue:/\b(part of|made of|has a|have a)\b/i},{family:"CapableOf",predicates:Object.freeze(["mgx:capableOf","mgxneg:capableOf"]),cue:/\b(capable of|able to)\b/i},{family:"UsedFor",predicates:Object.freeze(["mgx:usedFor"]),cue:/\b(used for|used to|use for)\b/i}]),MK=new Set([...iL,...Yv,"a","an","the","some","any","few","many","several","more","most","my","your","his","its","our","their","what","which","where","when","why","how","find","found","put","get","keep","store","place","buy","locate","hide","wear","carry","use","take","open","cross","need","want"])});function oa(e){let t=new Map;for(let[n,s]of e||[])!n||!s||n===s||(t.has(n)||t.set(n,new Set),t.get(n).add(s));return t}function hl(e,t,{cap:n=6,stopAt:s=null,toward:o=null}={}){let r=[e],i=new Set([e]),a=e;for(;r.length<n&&!(o&&a===o);){let c=[...t.get(a)||[]].filter(d=>!i.has(d)).sort(aL);if(!c.length)break;let l=o?c.filter(d=>d===o||kp(d,t).has(o)):[];a=(l.length?l:c)[0];let u=s&&s.has(a);if(u&&r.length>1||(i.add(a),r.push(a),u))break}return r}function kp(e,t,{cap:n=64}={}){let s=new Set([e]),o=[e];for(;o.length&&s.size<n;){let r=o.shift();for(let i of t.get(r)||[])s.has(i)||(s.add(i),o.push(i))}return s}function Rp(e,t,n,s){if(n.has(e))return n.get(e);if(s.has(e))return 1;s.add(e);let o=t.get(e),r=1;if(o&&o.size){let i=0;for(let a of o)i=Math.max(i,Rp(a,t,n,s));r=i+1}return s.delete(e),n.set(e,r),r}function cL(e){let t=new Map;for(let[n,s]of e||[])!n||!s||(t.has(n)||t.set(n,new Set),t.get(n).add(s),t.has(s)||t.set(s,new Set),t.get(s).add(n));return t}function lL(e,t,n,s,o,{threshold:r,rootDepth:i,icByTerm:a}){let c=kp(e,n),l=kp(t,n);if(c.has(t)||l.has(e))return{distinct:!1,reason:"subsumes",lcs:c.has(t)?t:e};if(s.size)for(let h of c){let g=s.get(h);if(g){for(let b of l)if(g.has(b))return{distinct:!0,reason:"disjoint",lcs:null}}}let u=[...c].filter(h=>l.has(h));if(!u.length)return c.size<2||l.size<2?{distinct:!1,reason:"inconclusive",lcs:null}:{distinct:!0,reason:"non-intersecting",lcs:null};let d=h=>Rp(h,n,o,new Set),p=u[0],f=d(p);for(let h of u){let g=d(h);(g>f||g===f&&h<p)&&(p=h,f=g)}if(f<=i)return{distinct:!0,reason:"root-subsumer",lcs:p};if(a){let h=a.get(p);return typeof h=="number"&&h<r?{distinct:!0,reason:"low-ic",lcs:p}:{distinct:!1,reason:"shared-lineage",lcs:p}}return 2*f/(d(e)+d(t))<r?{distinct:!0,reason:"shallow-subsumer",lcs:p}:{distinct:!1,reason:"shared-lineage",lcs:p}}function gl(e,{subClassEdges:t=[],parents:n=null,disjointEdges:s=[],threshold:o=.5,rootDepth:r=1,icByTerm:i=null}={}){let a=[...new Set((e||[]).filter(Boolean))],c=n||oa(t),l=cL(s),u=new Map,d=new Map(a.map(y=>[y,y])),p=y=>{for(;d.get(y)!==y;)d.set(y,d.get(d.get(y))),y=d.get(y);return y},f=(y,$)=>{let E=p(y),_=p($);E!==_&&d.set(E<_?_:E,E<_?E:_)},m=[];for(let y=0;y<a.length;y+=1)for(let $=y+1;$<a.length;$+=1){let E=lL(a[y],a[$],c,l,u,{threshold:o,rootDepth:r,icByTerm:i});m.push({a:a[y],b:a[$],...E}),E.distinct||f(a[y],a[$])}let h=new Map;for(let y of a){let $=p(y);h.has($)||h.set($,[]),h.get($).push(y)}let g=y=>Rp(y,c,u,new Set),b=[...h.values()].map(y=>{let $=[...y].sort(),E=$[0],_=g(E);for(let v of $){let S=g(v);S>_&&(_=S,E=v)}return{objects:$,label:E}}).sort((y,$)=>y.label.localeCompare($.label));return{split:b.length>1,clusters:b,pairs:m}}var aL,bl=M(()=>{Ot();na();aL=(e,t)=>e<t?-1:e>t?1:0});function _p(e){return typeof e=="string"&&uL.test(e)}function Jv(e){return!!e&&typeof e=="object"&&Go(e.s)}function Tp(e){return!!e&&typeof e=="object"&&e.kind==="fact"&&_p(e.world)&&Go(e.subject)&&Go(e.predicate)&&Go(e.object)}function Ap(e){if(!e||typeof e!="object"||e.kind!=="rule"||!_p(e.world)||!Go(e.name)||!fL.has(e.ruleKind)||!e.slots||typeof e.slots!="object"||Array.isArray(e.slots))return!1;let t=Object.values(e.slots);return t.length>0&&t.every(Go)}function Cp(e){return!!e&&typeof e=="object"&&e.kind==="meta"&&_p(e.world)&&Go(e.opening)}function Qv(e){return Tp(e)||Ap(e)||Cp(e)}function Zv(e){let t=e||[],n=t.filter(l=>l.predicate===pL).sort((l,u)=>`${l.subject}\0${l.object}`.localeCompare(`${u.subject}\0${u.object}`));if(!n.length)return t;let s=new Set(t.filter(l=>l.predicate==="rdf:type").map(l=>l.subject)),o=new Map;for(let l of t)l.predicate==="mgx:located-in"&&o.set(l.subject,l.object);let r=(l,u)=>t.some(d=>d.predicate==="rdf:type"&&d.object===l&&o.get(d.subject)===u),i=t.find(l=>typeof l.world=="string"&&l.kind==="fact"),a=(l,u,d)=>({...i?{world:i.world,kind:"fact"}:{},subject:l,predicate:u,object:d}),c=[];for(let l of n){let u=l.subject,d=l.object;if(r(d,u))continue;let p=d,f=1;for(;s.has(p);)f+=1,p=`${d}-${f}`;s.add(p),c.push(a(p,"rdf:type",d)),c.push(a(p,"rdf:type","portable")),c.push(a(p,"mgx:located-in",u))}return c.length?[...t,...c]:t}var uL,dL,fL,Go,pL,Vo=M(()=>{uL=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,dL=Object.freeze(["action-signature","action-precond","action-effect","action-constraint"]),fL=new Set(dL),Go=e=>typeof e=="string"&&e.trim()!=="";pL="mgx:default-contains"});var mL,hL,WK,ra=M(()=>{mL=Object.freeze(["mgx:consumes","mgx:display-name","mgx:evades","mgx:guards","mgx:hasMass","mgx:is-predator","mgx:mass-drain-per-turn","mgx:model","mgx:pursues","mgx:vision-radius"]),hL=Object.freeze(new Set(["mgx:consumes","mgx:evades","mgx:guards","mgx:pursues"])),WK=Object.freeze(["mgx:consumes","mgx:evades","mgx:pursues"])});var wl=M(()=>{});var gL,bL,wL,yL,$L,vL,xL,EL,SL,jL,kL,RL,_L,TL,AL,CL,IL,OL,NL,KK,LL,ex,YK,XK,tx=M(()=>{cs();pr();gL="subClassOf",bL="typeAssertion",wL="relation",yL="someValuesFrom",$L="cardinality",vL="disjointWith",xL="possessive",EL="adjective",SL="capability",jL="union",kL="complement",RL="negativeType",_L="enumeration",TL="differentFrom",AL="bareExistential",CL="transitiveRole",IL="inverseRole",OL="universal",NL="subPropertyOf",KK=Object.freeze([gL,bL,wL,yL,$L,vL,xL,EL,SL,jL,kL,RL,_L,TL,AL,CL,IL,OL,NL]),LL=new Set(["go","take","drop","open","unlock","close","give","look","talk","examine","dig","eat","put"]),ex=new Map([["pick up","take"],["pick","take"],["grab","take"],["put down","drop"],["set down","drop"],["leave","drop"],["talk to","talk"],["speak to","talk"],["speak with","talk"],["talk","talk"],["speak","talk"],["chat with","talk"],["converse with","talk"],["look at","examine"],["examine","examine"],["inspect","examine"],["have a look at","examine"],["take a look at","examine"],["check out","examine"],["shut","close"]]),YK=Math.max(...[...ex.keys()].map(e=>e.split(" ").length)),XK=[...new Set([...LL,...[...ex.keys()].map(e=>e.split(" ")[0])])]});var Ho=M(()=>{});var Ip=M(()=>{De();Jn();Ho()});function Bt({name:e,label:t,question:n,params:s=[],preconditions:o=[],add:r=[],del:i=[]}){return Object.freeze({type:lo.Capability,name:e,label:t,question:n,readOnly:!0,parameters:Object.freeze(s),preconditions:Object.freeze(o),effects:Object.freeze({add:Object.freeze(r),del:Object.freeze(i)})})}var PL,lo,Ee,ML,qo,mt,Qt,ln,FL,nx,Ut,DL,zL,sx,sY,oY,rY,Wr=M(()=>{PL=Object.freeze({cap:"urn:tmct:cap#",taught:"urn:tmct:taught#",mgx:"urn:tmct:mgx#",seon:"http://se-on.org/ontologies/seon.owl#"}),lo=Object.freeze({Capability:"cap:Capability",Parameter:"cap:Parameter",Precondition:"cap:Precondition",Effect:"cap:Effect"}),Ee=Object.freeze({Symbol:"seon:CodeEntity",Module:"mgx:Module",Class:"seon:ClassType",MemoryTerm:"mgx:MemoryTerm",Query:"cap:FreeText",Kind:"cap:KindFilter",Package:"cap:PackageName"}),ML=Object.freeze([Ee.MemoryTerm]),qo=Object.freeze({graphLoaded:"cap:graph-loaded",resolves:"cap:resolves",anyPresent:"cap:any-present",memoryFacts:"cap:memory-facts"}),mt=(e,t,{arg:n=e,required:s=!0,note:o=""}={})=>Object.freeze({type:lo.Parameter,name:e,kind:t,arg:n,required:s,note:o}),Qt=()=>Object.freeze({type:lo.Precondition,pred:qo.graphLoaded}),ln=(e,t)=>Object.freeze({type:lo.Precondition,pred:qo.resolves,param:e,as:t}),FL=e=>Object.freeze({type:lo.Precondition,pred:qo.anyPresent,params:Object.freeze([...e])}),nx=()=>Object.freeze({type:lo.Precondition,pred:qo.memoryFacts}),Ut=(e,t=null)=>Object.freeze({type:lo.Effect,pred:"cap:knows",topic:e,of:t?`?${t}`:null});DL=Object.freeze([Bt({name:"tmct_search",label:"search",question:"lexical search across the graph",params:[mt("query",Ee.Query,{required:!1,note:"required unless a kind filter is given"}),mt("kind",Ee.Kind,{required:!1}),mt("name",Ee.Query,{required:!1}),mt("decorator",Ee.Query,{required:!1})],preconditions:[Qt(),FL(["query","kind"])],add:[Ut("matches","query")]}),Bt({name:"tmct_describe",label:"describe",question:"a symbol's definition, kind and relations",params:[mt("symbol",Ee.Symbol)],preconditions:[Qt(),ln("symbol",Ee.Symbol)],add:[Ut("description","symbol")]}),Bt({name:"tmct_signature",label:"signature",question:"a symbol's signature only",params:[mt("symbol",Ee.Symbol)],preconditions:[Qt(),ln("symbol",Ee.Symbol)],add:[Ut("signature","symbol")]}),Bt({name:"tmct_impact",label:"impact",question:"what a change to this module or symbol reaches (impact closure)",params:[mt("module",Ee.Symbol,{note:"a Module, or any sited symbol \u2014 a fine-grained seed walks callsSymbol dependents and coarsens them to module grain"})],preconditions:[Qt(),ln("module",Ee.Symbol)],add:[Ut("impact","module")]}),Bt({name:"tmct_members",label:"members",question:"the methods/attributes of a class",params:[mt("class",Ee.Class,{arg:"class"})],preconditions:[Qt(),ln("class",Ee.Class)],add:[Ut("members","class")]}),Bt({name:"tmct_subclasses",label:"subclasses",question:"the subclasses of a class",params:[mt("class",Ee.Class,{arg:"class"})],preconditions:[Qt(),ln("class",Ee.Class)],add:[Ut("subclasses","class")]}),Bt({name:"tmct_exports",label:"exports",question:"a module's public exports",params:[mt("module",Ee.Module)],preconditions:[Qt(),ln("module",Ee.Module)],add:[Ut("exports","module")]}),Bt({name:"tmct_callers",label:"callers",question:"functions that call this symbol",params:[mt("symbol",Ee.Symbol)],preconditions:[Qt(),ln("symbol",Ee.Symbol)],add:[Ut("callers","symbol")]}),Bt({name:"tmct_callees",label:"callees",question:"functions this symbol calls",params:[mt("symbol",Ee.Symbol)],preconditions:[Qt(),ln("symbol",Ee.Symbol)],add:[Ut("callees","symbol")]}),Bt({name:"tmct_calls",label:"calls",question:"the call edges out of this symbol/module",params:[mt("symbol",Ee.Symbol)],preconditions:[Qt(),ln("symbol",Ee.Symbol)],add:[Ut("calls","symbol")]}),Bt({name:"tmct_tests_for",label:"tests",question:"the tests covering this symbol",params:[mt("symbol",Ee.Symbol)],preconditions:[Qt(),ln("symbol",Ee.Symbol)],add:[Ut("tests","symbol")]}),Bt({name:"tmct_untested",label:"untested",question:"symbols with no covering test",params:[],preconditions:[Qt()],add:[Ut("untested",null)]}),Bt({name:"tmct_history",label:"history",question:"the commit history of this symbol",params:[mt("symbol",Ee.Symbol)],preconditions:[Qt(),ln("symbol",Ee.Symbol)],add:[Ut("history","symbol")]}),Bt({name:"tmct_cochanges",label:"cochanges",question:"symbols that change together with this one",params:[mt("symbol",Ee.Symbol)],preconditions:[Qt(),ln("symbol",Ee.Symbol)],add:[Ut("cochanges","symbol")]}),Bt({name:"tmct_architecture",label:"arch",question:"the architecture overview (optional package filter)",params:[mt("package",Ee.Package,{required:!1})],preconditions:[Qt()],add:[Ut("architecture","package")]}),Bt({name:"tmct_related",label:"related",question:"a term's synonyms and related concepts (the SKOS view over the conversational-memory graph)",params:[mt("term",Ee.MemoryTerm,{note:"a concept term, matched against memory relation facts rather than resolved in the code graph"})],preconditions:[nx(),ln("term",Ee.MemoryTerm)],add:[Ut("related","term")]}),Bt({name:"tmct_sprite",label:"sprite",question:"the sprite for a class, with the expression and size asked for",params:[mt("class",Ee.MemoryTerm,{arg:"class",note:"a world class, matched against the memory graph's own fact rows rather than resolved in the code graph"}),mt("expression",Ee.Kind,{required:!1,note:"one of sprite-expressions.mjs's palette words, carried as an mgx:feels fact"}),mt("size",Ee.Kind,{required:!1,note:"a taught mgx:hasProperty size word, resolved to a render scale \u2014 not a template tier"})],preconditions:[nx(),ln("class",Ee.MemoryTerm)],add:[Ut("sprite","class")]})]),zL=e=>Object.freeze(e.reduce((t,n)=>(t[n.name]=n,t),Object.create(null))),sx=DL,sY=zL(sx),oY=Object.freeze({tmct_context:"unbounded edit-context bundle (multi-file); needs a size/budget precondition",tmct_context_more:"unbounded context continuation; same as tmct_context",tmct_snippet:"raw source-file read (reads the filesystem); needs a file-read + span precondition",tmct_ask:"the plain-English question entry point itself \u2014 calls ask.mjs directly and bypasses the capability planner; not one of the planner's operators",tmct_export:"reads the memory store's whole fact set with no discriminating param and no resolver goal frame; needs NL-reachability wiring before it can join",tmct_ingest:"writes into the memory store (grounds facts); capability() only models read-only operators, so a write path needs its own precondition/effect design first",tmct_file_history:"a module-grain cut of the same history edge tmct_history already models; no NL frame distinguishes the granularities yet",tmct_method_history:"a method-grain cut of the same history edge tmct_history already models; no NL frame distinguishes the granularities yet",tmct_class_history:"a class-grain cut of the same history edge tmct_history already models; no NL frame distinguishes the granularities yet"}),rY=Object.freeze({prefixes:PL,vocab:lo,kinds:Ee,precond:qo,get capabilities(){return sx}})});var Op=M(()=>{Wr()});var yl=M(()=>{Dn()});var Np=M(()=>{Wr()});function VL(e){let t={};for(let n of String(e).toLowerCase().match(/[a-z]+/g)||[])!t.expression&&Object.hasOwn(Hs,n)&&(t.expression=n),!t.size&&Hi([{predicate:GL,object:n}])!==1&&(t.size=n);return t}var RY,_Y,TY,AY,GL,CY,Lp=M(()=>{Jn();Kn();Vc();it();De();Ea();Zf();Wr();Np();RY=new RegExp(`\\b(?:${Object.keys(Hn).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s+")).join("|")})\\b`,"i"),_Y=Object.freeze({"reverse:calls":{topic:"callers",arg:"symbol"},"forward:calls":{topic:"callees",arg:"symbol"},"reverse:tests":{topic:"tests",arg:"symbol"},"forward:tests":{topic:"tests",arg:"symbol"},"reverse:inherits":{topic:"subclasses",arg:"class"},"forward:reexports":{topic:"exports",arg:"module"},"forward:contains":{topic:"members",arg:"class"},"when:touches":{topic:"history",arg:"symbol"},"forward:cochange":{topic:"cochanges",arg:"symbol"},"reverse:cochange":{topic:"cochanges",arg:"symbol"}}),TY=Object.freeze({imports:"no importer/imports query tool in the registry (there is no tmct_imports); refusing beats mis-routing to calls",uses:"a query-side UNION (imports+calls+callsSymbol) with no single capability; a router that must emit ONE call cannot honour it \u2014 refuse",defines:"Module->symbol `defines` has no dedicated capability (tmct_members is Class-scoped `contains`); refuse rather than answer a different grain",serves:"a provider-declared edge with no capability in the registry; the ask lane traverses it directly, so refusing here beats mis-routing to a code-grain tool",denotes:"a provider-declared edge with no capability in the registry; the ask lane traverses it directly, so refusing here beats mis-routing to a code-grain tool"}),AY=Object.freeze({}),GL="mgx:hasProperty";CY=Object.freeze([{re:/\buntested\b|\bwithout\s+(?:a\s+)?tests?\b|\bhas\s+no\s+tests?\b|\bneeds?\s+(?:a\s+)?tests?\b/i,topic:"untested",noArg:!0,skipIfSuperlative:!0},{re:/\bblast\s*radius\b|\bimpacts?\b|\bimpacted\b|what\s+(?:a\s+)?change.*(?:reach|affect|touch)|what\s+(?:depends?\s+on|dependents?)\b/i,topic:"impact",arg:"module"},{re:/\bcall[\s-]*edges?\b|\bcall[\s-]*graph\b|\boutgoing\s+calls?\b|\bcall[\s-]*sites?\s+(?:of|in|out|from)\b/i,topic:"calls",arg:"symbol"},{re:/\bcallees?\b|wh(?:at|o)\s+does\s+\S+\s+call\b/i,topic:"callees",arg:"symbol"},{re:/\bcallers?\b|who\s+calls\b|what\s+calls\b/i,topic:"callers",arg:"symbol"},{re:/\btests?\b.*\b(?:for|cover|covering|of)\b|which\s+tests?\b|covers?\b|covered\b|test\s+coverage\b/i,topic:"tests",arg:"symbol"},{re:/\bcochang|change[- ]coupl/i,topic:"cochanges",arg:"symbol"},{re:/\bexports?\b|\bpublic\s+api\b/i,topic:"exports",arg:"module"},{re:/\bsubclasses?\b|children\s+of\b|\bextends?\b/i,topic:"subclasses",arg:"class"},{re:/\bmembers?\b|\bmethods?\s+of\b|\battributes?\s+of\b/i,topic:"members",arg:"class"},{re:/\bhistory\b|who\s+changed\b|commits?\s+(?:that\s+)?touch/i,topic:"history",arg:"symbol"},{re:/\bsignature\b/i,topic:"signature",arg:"symbol"},{re:/\bsynonyms?\b|\banother\s+word\s+for\b|\brelated\s+(?:words?|concepts?|to)\b/i,topic:"related",arg:"term"},{re:/\bsprite\b|\bicon\b|\bavatar\b|\bpicture\s+of\b|\bwhat\s+does\s+.+\s+look\s+like\b/i,topic:"sprite",arg:"class",slots:VL},{re:/\bdescribe\b|\bexplain\b|what\s+is\b|tell\s+me\s+about\b|definition\s+of\b/i,topic:"description",arg:"symbol"},{re:/\bsearch\b|\bfind\b|look\s+for\b/i,topic:"matches",arg:"query"}])});var ix=M(()=>{});var qL,ax=M(()=>{Lp();Wr();Np();ix();Jn();qL=Object.freeze([Object.freeze({id:"coverage-invariant",kind:"maintenance",invariant:"an impactful module must be tested",focusClass:"Module",modes:Object.freeze(["scoped","global"]),subGoals:Object.freeze(["impact","untested"]),priorityTopic:"impact",coverageTopic:"untested",compose:Object.freeze({op:"intersect",a:Object.freeze({topic:"untested"}),b:Object.freeze({topic:"impact",of:"focus",withFocus:!0}),names:"the change's untested footprint",empty:"no coverage gap"}),achieves:"coverage-gap"}),Object.freeze({id:"cochange-risk-invariant",kind:"maintenance",invariant:"a module change-coupled with the focus must be tested",focusClass:"Module",modes:Object.freeze(["scoped"]),subGoals:Object.freeze(["cochanges","untested"]),priorityTopic:"cochanges",coverageTopic:"untested",compose:Object.freeze({op:"intersect",a:Object.freeze({topic:"cochanges",of:"focus"}),b:Object.freeze({topic:"untested"}),names:"the change-coupled untested set",empty:"every change-coupled module is tested"}),achieves:"cochange-risk"})])});var $l=M(()=>{wl();yl();Lp();ax();Wr();Op()});function XL(e=process.env){return e?.TMCT_WORLDS_PACK_DIR||ne(YL,"corpus","worlds")}function cx(e){try{return cl(Fr(e))}catch{return null}}function lx(e){if(Mp.has(e))return Mp.get(e);let t=null,n=cx(ne(e,"index.json.gz"));if(n)try{let s=JSON.parse(n.toString("utf8"));s&&typeof s=="object"&&!Array.isArray(s)&&(t=s)}catch{}return Mp.set(e,t),t}function JL(e,t){let n=lx(e);if(!n)return null;let s=n[String(t??"")];if(!Jv(s))return null;let o=`${e}\0${t}`;if(Fp.has(o))return Fp.get(o);let r=null,i=cx(ne(e,"shards",`${s.s}.jsonl.gz`));if(i){let a=[],c=[],l=null;for(let u of i.toString("utf8").split(`
167
+ `))if(u.trim())try{let d=JSON.parse(u);if(!Qv(d)||d.world!==t)continue;Tp(d)?a.push(d):Ap(d)?c.push(d):Cp(d)&&!l&&(l=d)}catch{}(a.length||c.length||l)&&(r={name:t,facts:Zv(a),rules:c,meta:l})}return Fp.set(o,r),r}var ZL,YL,Mp,Fp,QL,t3,vl=M(()=>{Wo();ll();co();Je();Vo();ZL={},YL=ne(ye(qt(ZL.url)),"..","..","..");Mp=new Map,Fp=new Map;QL=e=>({list:async()=>{let t=lx(e());return t?Object.keys(t).sort():null},load:async t=>JL(e(),t)}),t3=QL(()=>XL())});var u3,ux=M(()=>{Pt();Je();qs();si();Dn();qe();u3=ne(".tmct","memory","blocks")});var dx=M(()=>{Ho()});var px=M(()=>{qs();si();Ho()});var Dp=M(()=>{qs();si();Ho()});var mx=M(()=>{Dp();qs();ys();Ho()});var hx=M(()=>{});var gx=M(()=>{dx();px();Dp();mx();hx();Ho()});var bx=M(()=>{ux();qe();sc();el();gx();Ip()});function Gr(e,t){let n=parseInt(e.slice(1),16);return`rgba(${n>>16&255}, ${n>>8&255}, ${n&255}, ${t})`}function El(e){let t=n=>s0.map((s,o)=>`--${n}-t${o+1}: ${Gr(e[n],s)};`).join(" ");return[`--bg: ${e.bg}; --ink: ${e.ink}; --muted: ${e.muted}; --line: ${e.line}; --card: ${e.card};`,`--taught: ${e.taught}; --corpus: ${e.corpus}; --entail: ${e.entail}; --alert: ${e.alert};`,t("taught"),t("corpus"),t("entail"),`--taught-soft: ${Gr(e.taught,.12)}; --corpus-soft: ${Gr(e.corpus,.12)};`,`--entail-soft: ${Gr(e.entail,.14)}; --alert-soft: ${Gr(e.alert,.12)};`,`--sprite-pop: drop-shadow(0 0 .6px ${Gr(e.ink,e.popRimAlpha)}) drop-shadow(${e.popShadow});`].join(" ")}var xl,s0,n5,zp=M(()=>{ml();xl=Object.freeze({light:Object.freeze({bg:"#F7F6F2",ink:"#23272B",muted:"#6E7168",line:"#DDD9D0",card:"#FFFFFF",taught:"#2E7D4F",corpus:"#5A80AC",entail:"#B07C2E",alert:"#B0503F",popRimAlpha:.66,popShadow:"0 1px 1.2px rgba(0, 0, 0, .30)"}),dark:Object.freeze({bg:"#15181C",ink:"#E7E5DF",muted:"#9A9E95",line:"#2B3036",card:"#1C2126",taught:"#5FBE8B",corpus:"#6C93BF",entail:"#D9A554",alert:"#D08070",popRimAlpha:.45,popShadow:"0 1px 1.4px rgba(0, 0, 0, .55)"})}),s0=[.35,.65,1];n5=`
168
+ :root { color-scheme: light dark; ${El(xl.light)} }
169
+ @media (prefers-color-scheme: dark) { :root { ${El(xl.dark)} } }
170
+ :root[data-theme="dark"] { ${El(xl.dark)} }
171
+ :root[data-theme="light"] { ${El(xl.light)} }
172
+ `});var wx=M(()=>{zp()});var yx=M(()=>{zp()});var vx=M(()=>{qe();Vo();kn();Vr()});var Ex=M(()=>{ys();qe();wl();$l();Vr()});var Bp,d0,f0,p0,m0,h0,g0,e4,t4,Vr=M(()=>{Vo();ra();wl();tx();cs();Yc();Ip();Op();$l();yl();vl();qe();bx();wx();yx();vx();Ex();Bp="mgx:world-epoch",d0=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:hidden-in"]),f0=new Set(["mgx:on-top-of","mgx:on-plane","mgx:under"]),p0="mgx:is-open",m0="mgx:hasMass",h0="mgx:knows-about",g0="mgx:display-name",e4=new Set([...d0,...f0,p0,m0,h0,g0,"rdf:type",Bp]),t4=new RegExp("^(?:what\\s+foods?\\s+(?:do\\s+you\\s+know(?:\\s+about)?|have\\s+you\\s+(?:found|seen|heard\\s+(?:about|of))|do\\s+you\\s+know\\s+of)|what\\s+do\\s+you\\s+know\\s+about\\s+(?:any\\s+)?foods?|do\\s+you\\s+know\\s+(?:about|of)\\s+(?:any\\s+)?foods?|where\\s+is\\s+(?:the\\s+)?food)[?.!\\s]*$","i")});var Hr,s4,o4,r4,i4,a4,c4,uo=M(()=>{Hr=Object.freeze({spiderFly:Object.freeze({spiderInitialMass:15,spiderMassDecrementPerTurn:.5,flyInitialMass:10,flyMassDecrementPerTurn:1,spiderVisionRadius:4,flyVisionRadius:4,eggHatchDelayTurns:3,flySpawnIntervalTurns:3,eggLayMassThreshold:25,eggHatchCount:2,minHatchlingMass:3,webDurationTurns:10}),mud:Object.freeze({moleInitialMass:8,moleMassDecrementPerTurn:.06,moleSpeed:1,moleDigReach:1,voleInitialMass:6,voleMassDecrementPerTurn:.05,voleSpeed:1,voleDigReach:1,badgerInitialMass:20,badgerMassDecrementPerTurn:.08,badgerSpeed:2,badgerDigReach:2,groundhogInitialMass:12,groundhogMassDecrementPerTurn:.06,groundhogSpeed:2,groundhogDigReach:2,meerkatInitialMass:9,meerkatMassDecrementPerTurn:.05,meerkatSpeed:1,meerkatDigReach:1}),mudiii:Object.freeze({predatorInitialMass:20,predatorMassDecrementPerTurn:.08,predatorVisionRadius:4,preyInitialMass:8,preyMassDecrementPerTurn:.06,preyVisionRadius:3,preySpawnIntervalTurns:5,foodSpawnIntervalTurns:3,spawnedFoodMass:2,placedFoodMass:2,maxPreyPopulation:6,maxFoodItems:8,foodVisionGated:!0,blendPreyDecision:!1,preyThreatWeight:.5,teach:!1}),guessNumber:Object.freeze({defaultLo:1,defaultHi:100,maxBound:1e9}),adventure:Object.freeze({teach:!1}),planning:Object.freeze({maxDepth:300})}),s4=Object.freeze({spider_initial_mass:"spiderInitialMass",spider_mass_decrement_per_turn:"spiderMassDecrementPerTurn",fly_initial_mass:"flyInitialMass",fly_mass_decrement_per_turn:"flyMassDecrementPerTurn",spider_vision_radius:"spiderVisionRadius",fly_vision_radius:"flyVisionRadius",egg_hatch_delay_turns:"eggHatchDelayTurns",fly_spawn_interval_turns:"flySpawnIntervalTurns",egg_lay_mass_threshold:"eggLayMassThreshold",egg_hatch_count:"eggHatchCount",min_hatchling_mass:"minHatchlingMass",web_duration_turns:"webDurationTurns"}),o4=Object.freeze({mole_initial_mass:"moleInitialMass",mole_mass_decrement_per_turn:"moleMassDecrementPerTurn",mole_speed:"moleSpeed",mole_dig_reach:"moleDigReach",vole_initial_mass:"voleInitialMass",vole_mass_decrement_per_turn:"voleMassDecrementPerTurn",vole_speed:"voleSpeed",vole_dig_reach:"voleDigReach",badger_initial_mass:"badgerInitialMass",badger_mass_decrement_per_turn:"badgerMassDecrementPerTurn",badger_speed:"badgerSpeed",badger_dig_reach:"badgerDigReach",groundhog_initial_mass:"groundhogInitialMass",groundhog_mass_decrement_per_turn:"groundhogMassDecrementPerTurn",groundhog_speed:"groundhogSpeed",groundhog_dig_reach:"groundhogDigReach",meerkat_initial_mass:"meerkatInitialMass",meerkat_mass_decrement_per_turn:"meerkatMassDecrementPerTurn",meerkat_speed:"meerkatSpeed",meerkat_dig_reach:"meerkatDigReach"}),r4=Object.freeze({predator_initial_mass:"predatorInitialMass",predator_mass_decrement_per_turn:"predatorMassDecrementPerTurn",predator_vision_radius:"predatorVisionRadius",prey_initial_mass:"preyInitialMass",prey_mass_decrement_per_turn:"preyMassDecrementPerTurn",prey_vision_radius:"preyVisionRadius",prey_spawn_interval_turns:"preySpawnIntervalTurns",food_spawn_interval_turns:"foodSpawnIntervalTurns",spawned_food_mass:"spawnedFoodMass",placed_food_mass:"placedFoodMass",max_prey_population:"maxPreyPopulation",max_food_items:"maxFoodItems",food_vision_gated:"foodVisionGated",blend_prey_decision:"blendPreyDecision",prey_threat_weight:"preyThreatWeight",teach:"teach"}),i4=Object.freeze({teach:"teach"}),a4=Object.freeze({default_lo:"defaultLo",default_hi:"defaultHi",max_bound:"maxBound"}),c4=Object.freeze({max_depth:"maxDepth"})});var kx,b0,jl,w0,y0,Rx,_x,$0,v0,d4,x0,E0,Tx=M(()=>{uo();kx="spider-fly",b0=10,jl=Object.freeze({x:2,y:2}),w0=1,y0=Object.freeze({predator:Object.freeze({role:"predator",kind:"spider",idPrefix:"spider",hunts:"prey"}),prey:Object.freeze({role:"prey",kind:"fly",idPrefix:"fly",hunts:null}),food:null}),Rx=(e,t)=>`cell-${e}-${t}`,_x=(e,t,n,s)=>Math.max(Math.abs(e-n),Math.abs(t-s)),$0=(e,t)=>_x(e,t,jl.x,jl.y)<=w0,v0=Object.freeze({north:Object.freeze({dx:0,dy:-1}),south:Object.freeze({dx:0,dy:1}),east:Object.freeze({dx:1,dy:0}),west:Object.freeze({dx:-1,dy:0})}),d4=Object.freeze([Object.freeze(["poodle","dog"]),Object.freeze(["sheepdog","dog"]),Object.freeze(["dog","animal"]),Object.freeze(["spider","arachnid"]),Object.freeze(["arachnid","animal"]),Object.freeze(["fly","insect"]),Object.freeze(["insect","animal"])]),x0="a spider waits in its web; a fly drifts in from the edge of the board. Neither is yours to move. Watch, or address one by name in chat.",E0=Object.freeze({name:kx,gridSize:b0,opening:x0,boardNoun:"board",boardSubject:"board",cast:Object.freeze({predators:1,prey:1}),props:Object.freeze([]),staticWebAt:$0,webHomeCell:Rx(jl.x,jl.y)})});var Ax,Nx,m4,h4,g4,Wp,Cx,Ix,Ox,Gp,b4,w4,kl=M(()=>{uo();Ax=Object.freeze({predator:"fox",prey:"goblin",spawnedFood:"crumb",placedFood:"morsel"}),Nx=Object.freeze({north:Object.freeze({dx:0,dy:-1}),south:Object.freeze({dx:0,dy:1}),east:Object.freeze({dx:1,dy:0}),west:Object.freeze({dx:-1,dy:0})}),m4=Object.freeze(["north","northeast","east","southeast","south","southwest","west","northwest"]),h4=Object.freeze(["blacksmith","bush","cart","fence","house","inn","oak","stall","well"]),g4=Object.freeze([Ax.spawnedFood,Ax.placedFood]),Wp=e=>Object.freeze({...e,props:Object.freeze(e.props.map(t=>Object.freeze(t))),cast:Object.freeze(e.cast)}),Cx=Wp({name:"town-square",gridSize:12,opening:"a fox prowls the town square; goblins pick over the stalls for scraps. Neither is yours to move. Watch, or address one by name in chat.",cast:{predators:1,prey:3},props:[{id:"house-1",model:"house-1",cell:"cell-8-1",rotation:"180"},{id:"house-2",model:"house-2",cell:"cell-8-2",rotation:"180"},{id:"house-3",model:"house-3",cell:"cell-8-3",rotation:"180"},{id:"well-1",model:"well",cell:"cell-6-7",rotation:"0"},{id:"stall-1",model:"market-stall-1",cell:"cell-3-9",rotation:"90"},{id:"inn-1",model:"inn",cell:"cell-11-10",rotation:"270"}]}),Ix=Wp({name:"town-square-market",gridSize:10,opening:"market day in the town square: two rows of stalls, goblins working the lanes between them, and a fox somewhere among the crowd.",cast:{predators:1,prey:4},props:[{id:"stall-1",model:"market-stall-1",cell:"cell-2-4",rotation:"0"},{id:"stall-2",model:"market-stall-2",cell:"cell-3-4",rotation:"0"},{id:"stall-3",model:"market-stall-1",cell:"cell-4-4",rotation:"0"},{id:"stall-4",model:"market-stall-2",cell:"cell-6-4",rotation:"0"},{id:"stall-5",model:"market-stall-1",cell:"cell-7-4",rotation:"0"},{id:"stall-6",model:"market-stall-2",cell:"cell-8-4",rotation:"0"},{id:"stall-7",model:"market-stall-2",cell:"cell-2-7",rotation:"180"},{id:"stall-8",model:"market-stall-1",cell:"cell-3-7",rotation:"180"},{id:"stall-9",model:"market-stall-2",cell:"cell-4-7",rotation:"180"},{id:"stall-10",model:"market-stall-1",cell:"cell-6-7",rotation:"180"},{id:"stall-11",model:"market-stall-2",cell:"cell-7-7",rotation:"180"},{id:"stall-12",model:"market-stall-1",cell:"cell-8-7",rotation:"180"},{id:"well-1",model:"well",cell:"cell-5-5",rotation:"0"},{id:"blacksmith-1",model:"blacksmith",cell:"cell-10-5",rotation:"270"},{id:"cart-1",model:"cart",cell:"cell-1-1",rotation:"90"},{id:"cart-2",model:"cart",cell:"cell-10-10",rotation:"270"},{id:"bush-1",model:"bush",cell:"cell-10-1",rotation:"0"},{id:"bush-2",model:"bush",cell:"cell-1-10",rotation:"0"}]}),Ox=Wp({name:"town-square-chapel",gridSize:14,opening:"the chapel corner of the town square, fenced to the south and shaded by three oaks. Two foxes hunt here, and two goblins know it.",cast:{predators:2,prey:2},props:[{id:"inn-1",model:"inn",cell:"cell-2-2",rotation:"180"},{id:"house-1",model:"house-1",cell:"cell-3-2",rotation:"180"},{id:"house-2",model:"house-2",cell:"cell-2-3",rotation:"90"},{id:"fence-1",model:"fence",cell:"cell-7-11",rotation:"0"},{id:"fence-2",model:"fence",cell:"cell-8-11",rotation:"0"},{id:"fence-3",model:"fence",cell:"cell-9-11",rotation:"0"},{id:"oak-1",model:"oak-tree",cell:"cell-12-4",rotation:"0"},{id:"oak-2",model:"oak-tree",cell:"cell-12-12",rotation:"90"},{id:"oak-3",model:"oak-tree",cell:"cell-5-8",rotation:"180"}]}),Gp=Object.freeze({[Cx.name]:Cx,[Ix.name]:Ix,[Ox.name]:Ox}),b4=Object.freeze(Object.keys(Gp)),w4=Object.freeze([Object.freeze(["fox","canine"]),Object.freeze(["canine","animal"]),Object.freeze(["goblin","humanoid"]),Object.freeze(["humanoid","creature"]),Object.freeze(["creature","animal"]),Object.freeze(["crumb","food"]),Object.freeze(["morsel","food"]),Object.freeze(["food","thing"]),Object.freeze(["prop","thing"])])});var Vp=M(()=>{});var Lx=M(()=>{});var aa,G4,I0,O0,N0,L0,P0,M0,F0,D0,z0,U0,B0,W0,G0,V0,H0,q0,K0,V4,Hp=M(()=>{kl();Vp();ys();qe();Vo();Lx();it();uo();ra();Vr();aa=Object.freeze({predator:{role:"predator",kind:"fox",idPrefix:"fox",hunts:"prey"},prey:{role:"prey",kind:"goblin",idPrefix:"goblin",hunts:null},food:{spawnedKind:"crumb",placedKind:"morsel"}}),G4=Object.freeze(["predator","prey"]),I0="mgx:currently-in",O0="mgx:hasMass",N0="mgx:feels",L0="mgx:facing",P0="mgx:driven-facing",M0="mgx:eaten-by",F0="mgx:starved",D0="mgx:placed-by",z0="mgx:model",U0="mgx:rotation",B0="mgx:carrying",W0="mgx:prey-eaten",G0="mgx:web-built-at-turn",V0="mgx:laid-at-turn",H0="mgx:hatched-into",q0="mgx:turn-played",K0=new Set([I0,O0,N0,L0,P0,M0,F0,D0,z0,U0,q0,B0,W0,G0,V0,H0,"rdf:type",Bp]),V4=Object.freeze([...K0].sort())});var lX,uX,Mx=M(()=>{Tx();kl();Hp();Vo();vl();qe();uo();lX=new RegExp("^@(spider|fly)(?:-(\\d+))?[,:]?\\s+the\\s+(spider|fly)(?:-(\\d+))?\\s+is\\s+(?:(north|south|east|west)|at\\s+(cell-\\d+-\\d+))[.!?\\s]*$","i"),uX=Object.freeze({"catch-prey":"caught","eat-agent":"eaten",starve:"starved","lay-egg":"laid","hatch-egg":"hatched","spawn-prey":"spawned"})});var zX,UX,BX,WX,GX,VX,HX,Q0,Z0,e1,t1,Fx,Dx,n1,qX,KX,zx=M(()=>{kl();Hp();Vr();kn();Vo();vl();qe();uo();ra();Vp();yl();ys();zX=aa.predator.kind,UX=aa.prey.kind,BX=aa.food.spawnedKind,WX=aa.food.placedKind,GX=Object.freeze(new Set(["river-crossing"])),VX=new RegExp("^@(fox|goblin)(?:-(\\d+))?[,:]?\\s+the\\s+(fox|goblin|crumb|morsel)(?:-(\\d+))?\\s+is\\s+(?:(north|south|east|west)|at\\s+(cell-\\d+-\\d+))[.!?\\s]*$","i"),HX=new RegExp("^who\\s+(?:put|placed|dropped)\\s+(?:(?:the\\s+)?(morsel|crumb)(?:-(\\d+))?|(?:(?:the\\s+)?(?:food|morsel|crumb|that|it)\\s+)?(?:at|on)\\s+(cell-\\d+-\\d+))(?:\\s+there)?[?.!\\s]*$","i"),Q0="mgx:currently-in",Z0="mgx:hasMass",e1="mgx:feels",t1="mgx:facing",Fx="(fox|goblin|crumb|morsel)(?:-(\\d+))?",Dx="(fox|goblin)(?:-(\\d+))?",n1="(crumb|morsel)(?:-(\\d+))?",qX=[{kind:"placement",predicate:Q0,re:new RegExp(`^(?:the\\s+)?${Fx}\\s+is\\s+at\\s+(cell-\\d+-\\d+)[.!\\s]*$`,"i")},{kind:"mass",predicate:Z0,re:new RegExp(`^(?:the\\s+)?${Fx}\\s+weighs\\s+(\\d+(?:\\.\\d+)?)[.!\\s]*$`,"i")},{kind:"mood",predicate:e1,re:new RegExp(`^(?:the\\s+)?${Dx}\\s+feels\\s+(calm|angry|scared|happy)[.!\\s]*$`,"i")},{kind:"facing",predicate:t1,re:new RegExp(`^(?:the\\s+)?${Dx}\\s+faces\\s+(north|south|east|west)[.!\\s]*$`,"i")}],KX=new RegExp(`^(?:the\\s+)?([a-z][a-z-]*)\\s+(?:put|placed|dropped)\\s+(?:the\\s+)?${n1}\\s+there[.!\\s]*$`,"i")});var Ux=M(()=>{ra()});var Rt,t8,n8,s8,o8,r8,i8,a8,c8,l8,u8,d8,f8,p8,m8,h8,g8,b8,w8,s1,Bx=M(()=>{Rt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},t8=Rt("createRequire"),n8=Rt("readFileSync"),s8=Rt("access"),o8=Rt("readFile"),r8=Rt("writeFile"),i8=Rt("appendFile"),a8=Rt("mkdir"),c8=Rt("mkdtemp"),l8=Rt("rename"),u8=Rt("unlink"),d8=Rt("rm"),f8=Rt("stat"),p8=Rt("copyFile"),m8=Rt("readdir"),h8=Rt("createReadStream"),g8=Rt("createWriteStream"),b8=Rt("randomBytes"),w8=Rt("spawnSync"),s1=Rt("createInterface")});var _t,$8,v8,x8,E8,S8,j8,k8,R8,_8,T8,A8,C8,I8,O8,N8,L8,P8,Wx,M8,qp=M(()=>{_t=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},$8=_t("createRequire"),v8=_t("readFileSync"),x8=_t("access"),E8=_t("readFile"),S8=_t("writeFile"),j8=_t("appendFile"),k8=_t("mkdir"),R8=_t("mkdtemp"),_8=_t("rename"),T8=_t("unlink"),A8=_t("rm"),C8=_t("stat"),I8=_t("copyFile"),O8=_t("readdir"),N8=_t("createReadStream"),L8=_t("createWriteStream"),P8=_t("randomBytes"),Wx=_t("spawnSync"),M8=_t("createInterface")});var Gx=M(()=>{qp();Je();Pt();Je();Pi();Kt()});var Vx=M(()=>{});var o1,Hx=M(()=>{Pt();Je();qe();Vx();o1=ne(".tmct","sessions")});var qx=M(()=>{Pt();Je();Xc()});var Kx,Rl,Yx=M(()=>{Kx=Object.freeze({countNouns:{class:"Class",classes:"Class",function:"Function",functions:"Function",func:"Function",funcs:"Function",module:"Module",modules:"Module",file:"Module",files:"Module",package:"Package",packages:"Package",method:"Method",methods:"Method",attribute:"Attribute",attributes:"Attribute",variable:"GlobalVariable",variables:"GlobalVariable",global:"GlobalVariable",globals:"GlobalVariable",commit:"Commit",commits:"Commit",session:"Session",sessions:"Session"},classLabels:{Class:["class","classes"],Function:["function","functions"],Module:["module","modules"],Package:["package","packages"],Method:["method","methods"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"],Session:["session","sessions"]},helpRows:[["/find <query>","lexical search across the graph"],["/search <query>","alias of /find"],["/context <symbol>","the sized edit bundle for a symbol (start here to change code)"],["/snippet <symbol>","exact source of one function/class/method"],["/describe <symbol>","a symbol's definition, kind and relations"],["/signature <symbol>","a symbol's signature only"],["/members <class>","the methods/attributes of a class"],["/subclasses <class>","the subclasses of a class"],["/impact <module>","what a change to this module or symbol reaches (impact closure)"],["/callers <symbol>","functions that call this symbol"],["/callees <symbol>","functions this symbol calls"],["/tests <symbol>","the tests covering this symbol"],["/untested","symbols with no covering test"],["/history <symbol>","the commit history of this symbol"],["/exports <module>","a module's public exports"],["/arch [package]","the architecture overview (optional package filter)"]],missRecoveryPointer:"for code structure, index this repo with `tmct index`, or point me at a .tmct/graph.json with --repo <path> (or try `npm run example:mini`)."}),Rl=Object.freeze({countNouns:{},classLabels:{},helpRows:[],missRecoveryPointer:""})});var Tt,o6,r6,i6,a6,c6,l6,u6,d6,f6,p6,m6,h6,g6,b6,w6,y6,$6,v6,Xx,Jx=M(()=>{Tt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},o6=Tt("createRequire"),r6=Tt("readFileSync"),i6=Tt("access"),a6=Tt("readFile"),c6=Tt("writeFile"),l6=Tt("appendFile"),u6=Tt("mkdir"),d6=Tt("mkdtemp"),f6=Tt("rename"),p6=Tt("unlink"),m6=Tt("rm"),h6=Tt("stat"),g6=Tt("copyFile"),b6=Tt("readdir"),w6=Tt("createReadStream"),y6=Tt("createWriteStream"),$6=Tt("randomBytes"),v6=Tt("spawnSync"),Xx=Tt("createInterface")});var nE={};Lt(nE,{CONTEXT_PASSAGE_PREDICATE:()=>Zx,CO_OCCURS_PREDICATE:()=>_l,ingestUnknownFromAssertions:()=>a1,knownTermsFrom:()=>eE,passageFor:()=>tE});function eE(e,t){let n=new Set;for(let s of e?.individuals||[]){if(s?.class!==Et)continue;let o=a=>(s.attributes||[]).find(c=>c?.key===a)?.value,r=o("subject"),i=o("object");r&&n.add(q(r)),i&&n.add(q(i))}for(let s of t||[])s?.subject&&n.add(q(s.subject)),s?.object&&n.add(q(s.object));return n}function tE(e,t){let n=e?.surfaceText;if(typeof n=="string"&&n.trim())return n.replace(/\[\[([^\]]+)\]\]/g,"$1").replace(/\s+/g," ").trim();let s=fo(e?.start),o=fo(e?.end);return t?.surface&&s&&o?t.surface.replace("{start}",s).replace("{end}",o):null}function i1(e,t,n){let s=String(e||"").toLowerCase().replace(/[^a-z0-9\s]/g," ").split(/\s+/).filter(Boolean),o=[],r=new Set;for(let i=0;i<s.length&&o.length<Qx;i+=1){let a=[s[i]];i+1<s.length&&a.push(`${s[i]} ${s[i+1]}`);for(let c of a)if(!(r1.has(c)||r.has(c)||n.has(c))&&t.has(c)&&(o.push(c),r.add(c),o.length>=Qx))break}return o}async function a1(e,{assertions:t,map:n,mappedFacts:s=[],memory:o,provenancePrefix:r="corpus:unknown",limit:i=500}={}){if(!Array.isArray(t)||!n)return{captured:0,linked:0,appended:0,skipped:0};let a=o||await pt(e),c=eE(a,s),l=new Set,u=[];for(let f of t){if(l.size>=i)break;let m=n.get(f.rel);if(!m||m.ace!=="none")continue;let h=fo(f.start),g=fo(f.end);if(!h||!g)continue;let b=q(h),y=q(g),$=!c.has(b),E=!c.has(y);if(!$&&!E)continue;let _=tE(f,m);if(!_)continue;let v=[[h,g,$],[g,h,E]];for(let[S,C,x]of v){if(!x||l.size>=i)continue;let R=q(S);if(l.has(R))continue;let w=`${r} ${f.rel}`;u.push({subject:S,predicate:Zx,object:_,provenance:w}),u.push({subject:S,predicate:_l,object:C,provenance:w});let T=i1(_,c,new Set([b,y]));for(let I of T)u.push({subject:S,predicate:_l,object:I,provenance:w});l.add(R),c.add(R)}}if(!u.length)return{captured:0,linked:0,appended:0,skipped:0};let d=await as(e,u),p=u.filter(f=>f.predicate===_l).length;return{captured:l.size,linked:p,appended:d.appended,skipped:d.skipped}}var Zx,_l,r1,Qx,sE=M(()=>{qe();Tl();Zx="mgx:contextPassage",_l="mgx:coOccursWith",r1=new Set(["a","an","the","is","are","was","were","be","being","been","to","of","for","in","on","at","with","by","as","and","or","that","this","it","its","you","your","related","kind","used"]),Qx=3});var oE={};Lt(oE,{MAP_FILE:()=>la,SEON_CONCEPTS_FILE:()=>Al,SEON_DEFINITIONS_FILE:()=>c1,SLICE_FILE:()=>ca,TIER2_DIR:()=>ls,TIER2_MANIFEST_FILE:()=>l1,WORDNET_DIR:()=>ua,loadMap:()=>Il,loadSlice:()=>Cl,seedMemory:()=>d1,termText:()=>fo,toFacts:()=>Ol});async function Cl(e=ca){let t=Xx({input:hv(e,"utf8"),crlfDelay:1/0}),n=[],s=0;for await(let o of t){s+=1;let r=o.trim();if(!r)continue;let i;try{i=JSON.parse(r)}catch(a){throw new Error(`${e}:${s}: not valid JSON: ${a.message}`)}for(let a of["start","rel","end"])if(typeof i[a]!="string"||!i[a])throw new Error(`${e}:${s}: assertion missing "${a}"`);n.push(i)}return n}async function Il(e=la){let n=Fo(await Ie(e,"utf8")).relation||[],s=new Map;for(let o of n){if(!o.rel)throw new Error(`${e}: a [[relation]] row is missing "rel"`);if(s.has(o.rel))throw new Error(`${e}: duplicate mapping for ${o.rel}`);if(!u1.has(o.ace))throw new Error(`${e}: ${o.rel} has unknown ace pattern ${JSON.stringify(o.ace)}`);if(o.ace!=="none"&&!o.predicate)throw new Error(`${e}: ${o.rel} maps to ${o.ace} but names no predicate URI`);s.set(o.rel,o)}return s}function Ol(e,t,n="corpus:conceptnet"){let s=[];for(let o of e){let r=t.get(o.rel);if(!r)throw new Error(`slice/map drift: relation ${o.rel} has no row in conceptnet-map.toml`);if(r.ace==="none")continue;let i=fo(o.start),a=fo(o.end);if(!i||!a)continue;let c=r.predicate==="mgx:relatedTo"?n.replace(/^corpus:/,"corpus-weak:"):n;s.push({subject:i,predicate:r.predicate,object:a,provenance:`${c} ${o.rel}`})}return s}async function d1(e,{limit:t,slicePath:n=ca,mapPath:s=la,prefer:o,provenancePrefix:r,captureUnknownContext:i=!1,unknownContextLimit:a}={}){let[c,l]=await Promise.all([Cl(n),Il(s)]),u=Ol(c,l,r);if(Array.isArray(o)&&o.length){let y=new Map(o.map(($,E)=>[$,E]));u=u.slice().sort(($,E)=>(y.get($.predicate)??o.length)-(y.get(E.predicate)??o.length))}t!==void 0&&(u=u.slice(0,t));let d=(y,$,E)=>`${q(y)} ${$} ${q(E)}`,p=new Set,f=await pt(e);for(let y of f.individuals||[]){if(y?.class!=="Fact")continue;let $=E=>(y.attributes||[]).find(_=>_.key===E)?.value;p.add(d($("subject"),$("predicate"),$("object")))}let m=0,h=[];for(let y of u){let $=d(y.subject,y.predicate,y.object);if(p.has($)){m+=1;continue}p.add($),h.push(y)}let g=await as(e,h),b;if(i){let{ingestUnknownFromAssertions:y}=await Promise.resolve().then(()=>(sE(),nE));b=await y(e,{assertions:c,map:l,mappedFacts:u,memory:f,provenancePrefix:r?`${r}-unknown`:void 0,limit:a})}return{appended:g.appended,skipped:m+g.skipped,total:u.length,...b?{unknown:b}:{}}}var f1,qr,ca,la,Al,c1,ls,l1,ua,I6,u1,fo,Tl=M(()=>{Wo();Pt();Jx();co();Je();Tc();qe();f1={},qr=ne(ye(qt(f1.url)),"..","..",".."),ca=ne(qr,"corpus","conceptnet","slice.jsonl"),la=ne(qr,"src","adapters","corpus","conceptnet-map.toml"),Al=ne(qr,"corpus","domains","code","concepts.jsonl"),c1=ne(qr,"corpus","domains","code","definitions.jsonl"),ls=ne(qr,"corpus","tier2"),l1=ne(ls,"manifest.json"),ua=ne(qr,"corpus","wordnet"),I6=ne(ua,"manifest.json"),u1=new Set(["subClassOf","type","ObjectProperty","someValuesFrom","disjointWith","property","none"]);fo=e=>{let t=/^\/c\/en\/([^/]+)/.exec(String(e||""));return t?t[1].replace(/_/g," "):null}});var uE={};Lt(uE,{BUILTIN_EXTENSIONS:()=>g1,EXTENSION_KINDS:()=>Nl,activeDomainPacks:()=>Qp,defaultCodeDomainPacks:()=>lE,defaultCodeLaneVocab:()=>cE,mergedLaneVocab:()=>Jp,mergedLexiconExtra:()=>aE,resolveExtensions:()=>iE,seedActiveCorpusEntries:()=>y1,validateExtensionEntry:()=>rE,validateExtensionPack:()=>v1});function Ll(){return{seon:{kind:"corpus",active:!1,corpusPath:Al,provenancePrefix:"corpus:seon"},code:{kind:"pack",active:!1,corpusPath:Al,provenancePrefix:"corpus:seon",vocabPath:m1,vocabData:Kx,groundingKind:"extraction",groundingAdapter:"tmct index (the graphPaths provider seam)"},conceptnet:{kind:"corpus",active:!1,corpusPath:ca,provenancePrefix:"corpus:conceptnet",limit:void 0,prefer:h1},human:{kind:"corpus",active:!0,corpusPath:ne(ls,"human.jsonl"),provenancePrefix:"corpus:human"},"human-medium":{kind:"corpus",active:!1,corpusPath:ne(ls,"human-medium.jsonl"),provenancePrefix:"corpus:human-medium"},"human-large":{kind:"corpus",active:!1,corpusPath:ne(ls,"human-large.jsonl"),provenancePrefix:"corpus:human-large"},"tier2-aws":{kind:"pack",active:!1,corpusPath:ne(ls,"aws.jsonl"),provenancePrefix:"corpus:tier2-aws",vocabPath:Kp,vocabData:Rl,groundingKind:"taught-only"},"tier2-python":{kind:"pack",active:!1,corpusPath:ne(ls,"python.jsonl"),provenancePrefix:"corpus:tier2-python",vocabPath:Kp,vocabData:Rl,groundingKind:"taught-only"},"tier2-java":{kind:"pack",active:!1,corpusPath:ne(ls,"java.jsonl"),provenancePrefix:"corpus:tier2-java",vocabPath:Kp,vocabData:Rl,groundingKind:"taught-only"},"tier2-general":{kind:"corpus",active:!1,corpusPath:ne(ls,"general.jsonl"),provenancePrefix:"corpus:tier2-general"},"wordnet-xl":{kind:"corpus",active:!1,corpusPath:ne(ua,"wordnet-xl.jsonl"),provenancePrefix:"corpus:wordnet-xl"},"wordnet-full":{kind:"corpus",active:!1,corpusPath:ne(ua,"wordnet-full.jsonl"),provenancePrefix:"corpus:wordnet-full"},namenet:{kind:"corpus",active:!1,corpusPath:ne(p1,"namenet.jsonl"),provenancePrefix:"corpus:namenet"}}}function rE(e,t){if(!t||typeof t!="object")throw new Error(`extension "${e}": entry must be an object`);if(!Nl.includes(t.kind))throw new Error(`extension "${e}": unknown kind ${JSON.stringify(t.kind)} (must be one of ${Nl.join(", ")})`);if(t.active!==void 0&&typeof t.active!="boolean")throw new Error(`extension "${e}": "active" must be a boolean`);if(t.kind==="corpus"&&!t.corpusPath)throw new Error(`extension "${e}": a "corpus" entry needs corpus_path`);if(t.kind==="ontology"&&!t.corpusPath)throw new Error(`extension "${e}": an "ontology" entry needs ontology_path`);if(t.kind==="lexicon"&&!t.lexiconPath)throw new Error(`extension "${e}": a "lexicon" entry needs lexicon_path`);if(t.kind==="templates"&&!t.templatesPath)throw new Error(`extension "${e}": a "templates" entry needs templates_path`);if(t.kind==="pack"&&!t.corpusPath&&!t.lexiconPath&&!t.templatesPath&&!t.phrasebookPath)throw new Error(`extension "${e}": a "pack" entry needs at least one of corpus_path/lexicon_path/templates_path/phrasebook_path`);if(t.limit!==void 0&&!Number.isFinite(t.limit))throw new Error(`extension "${e}": "limit" must be a finite number`);if(t.prefer!==void 0&&!Array.isArray(t.prefer))throw new Error(`extension "${e}": "prefer" must be an array of predicate URIs`)}function w1(e,t,n,s){if(!t&&n.kind===void 0)throw new Error(`extension "${e}": an unrecognized extension needs a "kind" (one of ${Nl.join(", ")})`);let o={kind:n.kind!==void 0?n.kind:t?.kind,active:n.active!==void 0?!!n.active:!!t?.active},r=[["corpus_path","corpusPath"],["ontology_path","corpusPath"],["lexicon_path","lexiconPath"],["templates_path","templatesPath"],["phrasebook_path","phrasebookPath"],["map_path","mapPath"],["vocab_path","vocabPath"]];for(let[i,a]of r)n[i]!==void 0?o[a]=b1(s,n[i]):t?.[a]!==void 0&&(o[a]=t[a]);return o.provenancePrefix=n.provenance_prefix!==void 0?String(n.provenance_prefix):t?.provenancePrefix??`corpus:${e}`,n.limit!==void 0?o.limit=Number(n.limit):t?.limit!==void 0&&(o.limit=t.limit),n.prefer!==void 0?o.prefer=n.prefer:t?.prefer!==void 0&&(o.prefer=t.prefer),n.grounding_kind!==void 0?o.groundingKind=String(n.grounding_kind):t?.groundingKind!==void 0&&(o.groundingKind=t.groundingKind),n.grounding_adapter!==void 0?o.groundingAdapter=String(n.grounding_adapter):t?.groundingAdapter!==void 0&&(o.groundingAdapter=t.groundingAdapter),o}async function iE(e,{configFile:t}={}){let n=e?await Ic(e,t?{file:t}:{}):null,s=Ll(),o=n&&n.extensions&&typeof n.extensions=="object"?n.extensions:{},r=n&&n.bias&&typeof n.bias=="object"?n.bias:{},i=new Set([...Object.keys(s),...Object.keys(o)]),a=new Map;for(let p of i){let f=w1(p,s[p]||null,o[p]||{},e||process.cwd());rE(p,f),a.set(p,f)}let c={};for(let[p,f]of Object.entries(r)){if(typeof f!="number"||!Number.isFinite(f))throw new Error(`[bias] "${p}": bias must be a finite number, got ${JSON.stringify(f)}`);c[p]=f}let u=["seon","conceptnet",...[...a.keys()].filter(p=>p!=="seon"&&p!=="conceptnet").sort()].filter(p=>a.has(p));return{entries:new Map(u.map(p=>[p,a.get(p)])),biasByBundle:c}}async function y1(e,t,n={}){let{seedMemory:s}=await Promise.resolve().then(()=>(Tl(),oE)),{captureUnknownContext:o,unknownContextLimit:r}=n,i={},a=0,c=0,l=0;for(let[u,d]of t instanceof Map?t:new Map)if(!(!d.active||!(d.kind==="corpus"||d.kind==="ontology"||d.kind==="pack"&&d.corpusPath)))try{let f=await s(e,{slicePath:d.corpusPath,mapPath:d.mapPath,provenancePrefix:d.provenancePrefix,limit:d.limit,prefer:d.prefer,captureUnknownContext:o,unknownContextLimit:r});i[u]={appended:f.appended,skipped:f.skipped,total:f.total},a+=f.appended,c+=f.skipped,l+=f.total}catch(f){i[u]={appended:0,skipped:0,total:0,error:f&&f.message?f.message:String(f)}}return{appended:a,skipped:c,total:l,perBundle:i}}async function aE(e,t={}){let n=[];for(let[o,r]of e instanceof Map?e:new Map)r.active&&(r.kind!=="lexicon"&&r.kind!=="pack"||r.lexiconPath&&n.push({name:o,path:r.lexiconPath,bias:t[o]??1}));if(!n.length)return null;n.sort((o,r)=>o.bias-r.bias);let s={nouns:{},verbs:{},adjectives:{},properNames:[]};for(let o of n){let r;try{r=JSON.parse(await Ie(o.path,"utf8"))}catch(i){throw new Error(`extension "${o.name}": lexicon file ${o.path} \u2014 ${i&&i.message?i.message:i}`)}if(Object.assign(s.nouns,r.nouns||{}),Object.assign(s.verbs,r.verbs||{}),Object.assign(s.adjectives,r.adjectives||{}),Array.isArray(r.properNames))for(let i of r.properNames)s.properNames.includes(i)||s.properNames.push(i)}return s}async function Jp(e,t={}){let n=[];for(let[o,r]of e instanceof Map?e:new Map)r.active&&r.kind==="pack"&&(!r.vocabPath&&!r.vocabData||n.push({name:o,path:r.vocabPath,data:r.vocabData,bias:t[o]??1}));let s={countNouns:{},classLabels:{},helpRows:[],missRecoveryPointer:""};if(!n.length)return s;n.sort((o,r)=>o.bias-r.bias);for(let o of n){let r;if(o.data)r=o.data;else try{r=JSON.parse(await Ie(o.path,"utf8"))}catch(i){throw new Error(`extension "${o.name}": vocab file ${o.path} \u2014 ${i&&i.message?i.message:i}`)}Object.assign(s.countNouns,r.countNouns||{}),Object.assign(s.classLabels,r.classLabels||{}),Array.isArray(r.helpRows)&&s.helpRows.push(...r.helpRows),r.missRecoveryPointer&&(s.missRecoveryPointer=r.missRecoveryPointer)}return s}function cE(){if(!Yp){let e={...Ll().code,active:!0};Yp=Jp(new Map([["code",e]]),{})}return Yp}async function $1(e,t){let n={name:e,groundingKind:t.groundingKind||"",groundingAdapter:t.groundingAdapter||"",commandCount:0,countNounCount:0};if(!t.vocabPath)return n;try{let s=JSON.parse(await Ie(t.vocabPath,"utf8"));n.commandCount=Array.isArray(s.helpRows)?s.helpRows.length:0,n.countNounCount=Object.keys(s.countNouns||{}).length}catch{}return n}async function Qp(e,t={}){let n=[];for(let[o,r]of e instanceof Map?e:new Map)r.active&&r.kind==="pack"&&n.push({name:o,entry:r,bias:t[o]??1});n.sort((o,r)=>o.bias-r.bias||o.name.localeCompare(r.name));let s=[];for(let o of n)s.push(await $1(o.name,o.entry));return s}function lE(){if(!Xp){let e={...Ll().code,active:!0};Xp=Qp(new Map([["code",e]]),{})}return Xp}async function v1(e,t){let n=[],s=o=>o&&(ru(o)?o:Gt(e,o));if(t.corpusPath){let o=s(t.corpusPath);try{let r=await Cl(o),i=await Il(s(t.mapPath)||la),a=Ol(r,i,t.provenancePrefix||"corpus:pack");n.push({kind:"corpus",path:o,ok:!0,counts:{assertions:r.length,facts:a.length}})}catch(r){n.push({kind:"corpus",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.lexiconPath){let o=s(t.lexiconPath);try{let{loadLexicon:r}=await Promise.resolve().then(()=>(cs(),Sv)),i=JSON.parse(await Ie(o,"utf8")),a=r(i);n.push({kind:"lexicon",path:o,ok:!0,counts:{nouns:a.nouns.size,verbs:a.verbs.size,adjectives:a.adjectives.size,properNames:a.properNames.size}})}catch(r){n.push({kind:"lexicon",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.templatesPath){let o=s(t.templatesPath);try{let{loadTemplates:r}=await Promise.resolve().then(()=>(Jc(),pv)),i=await r(o),a=[...i.keys()].filter(c=>!c.includes(":"));if(a.length)throw new Error(`template id${a.length>1?"s":""} not namespaced "<packname>:<id>": ${a.join(", ")}`);n.push({kind:"templates",path:o,ok:!0,counts:{templates:i.size}})}catch(r){n.push({kind:"templates",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.vocabPath){let o=s(t.vocabPath);try{let r=JSON.parse(await Ie(o,"utf8")),i=r.countNouns&&typeof r.countNouns=="object"?Object.keys(r.countNouns).length:0,a=r.classLabels&&typeof r.classLabels=="object"?Object.keys(r.classLabels).length:0,c=Array.isArray(r.helpRows)?r.helpRows.length:0;n.push({kind:"vocab",path:o,ok:!0,counts:{countNouns:i,classLabels:a,helpRows:c}})}catch(r){n.push({kind:"vocab",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.kind==="pack"){let o=t.groundingKind;o!=="extraction"&&o!=="taught-only"?n.push({kind:"grounding",path:"(pack manifest)",ok:!1,error:`a "pack" entry needs "grounding_kind" of "extraction" or "taught-only" (got ${JSON.stringify(o??null)})`}):o==="extraction"&&!t.groundingAdapter?n.push({kind:"grounding",path:"(pack manifest)",ok:!1,error:'grounding_kind "extraction" needs "grounding_adapter" naming the adapter'}):n.push({kind:"grounding",path:"(pack manifest)",ok:!0,counts:o==="extraction"?{channel:o,adapter:t.groundingAdapter}:{channel:o}})}return{ok:n.length>0&&n.every(o=>o.ok),results:n}}var Zp,p1,m1,Kp,Nl,h1,g1,b1,Yp,Xp,em=M(()=>{Je();Pt();co();Yx();Pi();Tl();Zp={},p1=ne(ye(qt(Zp.url)),"..","..","corpus","namenet"),m1=ne(ye(qt(Zp.url)),"..","..","corpus","domains","code","vocab.json"),Kp=ne(ye(qt(Zp.url)),"..","..","corpus","tier2","vocab-empty.json"),Nl=Object.freeze(["corpus","lexicon","templates","pack","ontology"]),h1=["rdfs:subClassOf","rdf:type","mgx:usedFor","mgx:partOf","mgx:capableOf","mgx:atLocation","mgx:causes","mgx:desires","mgx:motivatedByGoal","mgx:hasSubevent"];g1=Object.freeze(Ll());b1=(e,t)=>{if(t==null)return;let n=String(t);return ru(n)?n:Gt(e,n)};Yp=null;Xp=null});var dE=M(()=>{});var fE=M(()=>{Je();Wo();Pt();vp();Bx();qp();Kt();Gx();De();Hx();Xc();qx();ni();em();sa();uo();Yc();$l();yp();Ep();Br();dE()});var pE={};Lt(pE,{proseLemma:()=>S1});function S1(){if(Ko!==void 0)return Ko;try{let e=tl();if(!e)return Ko=null,Ko;let t=e.its,n=new Map;Ko=s=>{let o=String(s||"");if(n.has(o))return n.get(o);let r;try{r=String(e.readDoc(o).tokens().out(t.lemma)[0]||o).toLowerCase()}catch{r=o.toLowerCase()}return n.set(o,r),r}}catch{Ko=null}return Ko}var Ko,mE=M(()=>{nl()});var hE={};Lt(hE,{digestTermFromRows:()=>R1,loadDigestStructureTable:()=>k1,readDigestStructures:()=>j1});var j1,k1,R1,gE=M(()=>{j1=()=>null,k1=()=>null,R1=()=>null});var cm={};Lt(cm,{DEFAULT_MODULE_HOPS:()=>om,DEFAULT_PROVE_BRANCHES:()=>jE,DEFAULT_PROVE_NODES:()=>kE,DEFAULT_PROVE_STEPS:()=>SE,MAX_PROVEN_CASES:()=>_E,MAX_ROLE_ASSERTIONS:()=>RE,TABLEAU_RULE_CONFIDENCE:()=>O1,buildTableauKb:()=>nP,canonicalKey:()=>Ge,extractTableauModule:()=>rP,findTableauViolations:()=>oP,isSatisfiable:()=>im,moduleHasDlShape:()=>aP,proveEntailment:()=>Q1,proveSubsumption:()=>Z1,proveSubsumptionOfNegation:()=>eP,toNNF:()=>Zt});function Ge(e){if(!e||typeof e!="object"||typeof e.t!="string")throw new TypeError("canonicalKey: expr must be a concept-expression object carrying a t tag");switch(e.t){case"top":return"top";case"bot":return"bot";case"atom":return`atom(${e.name})`;case"nom":return`nom(${e.ind})`;case"not":return`not(${Ge(e.c)})`;case"and":return`and(${e.cs.map(Ge).sort().join(",")})`;case"or":return`or(${e.cs.map(Ge).sort().join(",")})`;case"some":return`some(${e.r},${Ge(e.c)})`;case"all":return`all(${e.r},${Ge(e.c)})`;case"atLeast":return`atLeast(${e.n},${e.r},${Ge(e.c)})`;case"atMost":return`atMost(${e.n},${e.r},${Ge(e.c)})`;default:throw new TypeError(`canonicalKey: unknown expression tag "${e.t}"`)}}function da(e,t){if(!e||typeof e!="object"||typeof e.t!="string")throw new TypeError("toNNF: expr must be a concept-expression object carrying a t tag");switch(e.t){case"top":return t?{t:"bot"}:{t:"top"};case"bot":return t?{t:"top"}:{t:"bot"};case"atom":return t?{t:"not",c:{t:"atom",name:e.name}}:{t:"atom",name:e.name};case"nom":return t?{t:"not",c:{t:"nom",ind:e.ind}}:{t:"nom",ind:e.ind};case"not":return da(e.c,!t);case"and":case"or":{let n=e.t==="and"?"or":"and",s=e.cs.map(o=>da(o,t));return s.sort((o,r)=>Ge(o).localeCompare(Ge(r))),{t:t?n:e.t,cs:s}}case"some":case"all":{let n=e.t==="some"?"all":"some",s=da(e.c,t);return{t:t?n:e.t,r:e.r,c:s}}case"atLeast":case"atMost":{let n=da(e.c,!1);return t?e.t==="atLeast"?{t:"atMost",n:e.n-1,r:e.r,c:n}:{t:"atLeast",n:e.n+1,r:e.r,c:n}:{t:e.t,n:e.n,r:e.r,c:n}}default:throw new TypeError(`toNNF: unknown expression tag "${e.t}"`)}}function Zt(e){return da(e,!1)}function Wt(e){return[...new Set((Array.isArray(e)?e:[]).filter(Boolean))].sort()}function nm(e,t){let n=Number(e);return Number.isFinite(n)&&n>0?Math.floor(n):t}function A1(e,t){let n=Number(e);return Number.isFinite(n)&&n>=0?Math.floor(n):t}function EE(e,t){let n=new Set(e),s=!0;for(;s;){s=!1;for(let o of t)n.has(o.subject)&&!n.has(o.object)&&(n.add(o.object),s=!0),n.has(o.object)&&!n.has(o.subject)&&(n.add(o.subject),s=!0)}return n}function C1(e){let t=new Map;for(let[s,o]of e||[])!s||!o||s===o||(t.has(s)||t.set(s,new Set),t.get(s).add(o));let n=new Map;return s=>{if(n.has(s))return n.get(s);let o=new Set,r=[...t.get(s)||[]];for(;r.length;){let i=r.pop();if(!o.has(i)){o.add(i);for(let a of t.get(i)||[])o.has(a)||r.push(a)}}return n.set(s,o),o}}function I1(e,t){let n=(e||[]).map(([r,i])=>[fs(r),fs(i)]),s=C1(n.map(([r,i])=>[i,r])),o=new Map;for(let r of t){let i=fs(r);o.set(i,new Set([i,...s(i)]))}return o}function bE(e,t,n){let s=fs(t),o=fs(n);if(s===o)return!0;let r=e&&e.roleClosure?e.roleClosure.get(o):null;return r?r.has(s):!1}function Fl(e,t,n,s){let o=[];for(let r of e.edges)if(r.from===n&&bE(t,r.r,s))o.push({to:r.to,fromFacts:r.fromFacts});else if(r.to===n){let i=t&&t.inverseOf?t.inverseOf.get(fs(r.r)):null;i&&bE(t,i,s)&&o.push({to:r.from,fromFacts:r.fromFacts})}return o}function Pl(e,t){return t==="fresh-0"?!1:e&&e.namedIndividuals&&e.namedIndividuals.has(t)?!0:!N1.test(t)}function fa(e,t){return e<t?`${e}\u241F${t}`:`${t}\u241F${e}`}function L1(e,t,n,s){if(t===n)return;let o=fa(t,n),r=e.inequalityFrom.get(o);e.inequalityFrom.set(o,Wt(r?[...r,...s]:s))}function TE(e,t,n,s){return n===s?!1:Pl(t,n)&&Pl(t,s)?!0:e.inequalityFrom.has(fa(n,s))}function AE(e,t,n){let s=e.inequalityFrom.get(fa(t,n));return s?s.slice():[]}function P1(e,t,n){let s=Pl(e,t),o=Pl(e,n);return s&&!o?[t,n]:o&&!s?[n,t]:t<n?[t,n]:[n,t]}function CE(e,t,n,s){if(n===s)return n;let[o,r]=P1(t,n,s),i=e.nodes.get(o),a=e.nodes.get(r);if(!i||!a)return o;for(let[d,{expr:p,from:f}]of a.labels){let m=i.labels.get(d);i.labels.set(d,{expr:p,from:m?Wt([...m.from,...f]):f.slice()})}let c=[],l=new Map;for(let d of e.edges){let p=d.from===r?o:d.from,f=d.to===r?o:d.to,m=`${p}\u241F${d.r}\u241F${f}`,h=l.get(m);if(h)h.fromFacts=Wt([...h.fromFacts,...d.fromFacts]);else{let g={from:p,r:d.r,to:f,fromFacts:d.fromFacts.slice()};l.set(m,g),c.push(g)}}e.edges=c;for(let d of e.nodes.values())d.parent===r&&(d.parent=o);let u=new Map;for(let[d,p]of e.inequalityFrom){let[f,m]=d.split("\u241F"),h=f===r?o:f,g=m===r?o:m;if(h===g)continue;let b=fa(h,g),y=u.get(b);u.set(b,y?Wt([...y,...p]):p)}return e.inequalityFrom=u,e.nodes.delete(r),o}function rm(e,t){return{id:e,labels:new Map,parent:t??null,branchedOn:new Set,appliedAxioms:new Set,successorCount:0}}function Wn(e,t,n){let s=Ge(t);return e.labels.has(s)?!1:(e.labels.set(s,{expr:t,from:Wt(n)}),!0)}function Kr(e){return[...e.labels.entries()].sort((t,n)=>t[0].localeCompare(n[0]))}function Ml(e){if(e.labels.has("bot"))return{nodeId:e.id,keyA:"bot",keyB:"bot",premises:e.labels.get("bot").from.slice()};let t=[...e.labels.keys()].sort();for(let n of t){let{expr:s,from:o}=e.labels.get(n),r=Ge(Zt(ds(s)));if(r<=n)continue;let i=e.labels.get(r);if(i)return{nodeId:e.id,keyA:n,keyB:r,premises:Wt([...o,...i.from])}}return null}function wE(e,t){let n=new Set;for(let s of e.edges)s.to===t&&n.add(s.r);return n}function IE(e,t,n){let s=[...e.labels.keys()],o=!!(n&&n.inverseOf&&n.inverseOf.size>0),r=o?wE(t,e.id):null,i=e.parent;for(;i;){let a=t.nodes.get(i);if(!a)break;if(s.length===a.labels.size&&s.every(c=>a.labels.has(c))){if(!o)return!0;let c=wE(t,a.id);if(r.size===c.size&&[...r].every(l=>c.has(l)))return!0}i=a.parent}return!1}function yE(e){let t=new Map;for(let[n,s]of e.nodes)t.set(n,{id:s.id,labels:new Map(s.labels),parent:s.parent,branchedOn:new Set(s.branchedOn),appliedAxioms:new Set(s.appliedAxioms),successorCount:s.successorCount});return{nodes:t,edges:e.edges.slice(),closed:!1,clash:null,inequalityFrom:new Map(e.inequalityFrom),choices:(e.choices||[]).slice()}}function M1(e){for(let t of e.nodes.values())for(let[,{expr:n,from:s}]of Kr(t)){if(n.t!=="and")continue;let o=!1;for(let r of n.cs)Wn(t,r,s)&&(o=!0);if(o)return{applied:!0,touched:[t.id]}}return{applied:!1,touched:[]}}function F1(e,t){let n=new Map;for(let o of e.nodes.values())for(let r of o.labels.keys())r.startsWith("nom(")&&(n.has(r)||n.set(r,[]),n.get(r).push(o.id));let s=[...n.keys()].sort();for(let o of s){let r=[...new Set(n.get(o))].sort();if(r.length<2)continue;let[i,a]=r;if(TE(e,t,i,a)){let c=e.nodes.get(i).labels.get(o)?.from||[],l=e.nodes.get(a).labels.get(o)?.from||[];return{kind:"clash",clash:{nodeId:i,keyA:o,keyB:`merge(${i},${a})`,premises:Wt([...c,...l,...AE(e,i,a)])}}}return{kind:"merge",a:i,b:a}}return{kind:"none"}}function D1(e,t){let n=t&&t.transitiveRoles instanceof Set?t.transitiveRoles:null;for(let s of e.nodes.values())for(let[,{expr:o,from:r}]of Kr(s)){if(o.t!=="all")continue;let i=[];for(let{to:a,fromFacts:c}of Fl(e,t,s.id,o.r)){let l=e.nodes.get(a);if(!l)continue;let u=[...r,...c];Wn(l,o.c,u)&&i.push(l.id),n&&n.has(o.r)&&Wn(l,o,u)&&i.push(l.id)}if(i.length)return{applied:!0,touched:i}}return{applied:!1,touched:[]}}function z1(e,t){for(let n of e.nodes.values())for(let s=0;s<t.axioms.length;s+=1){if(n.appliedAxioms.has(s))continue;let o=t.axioms[s];if(n.appliedAxioms.add(s),Wn(n,o.disjunction,o.from))return{applied:!0,touched:[n.id]}}return{applied:!1,touched:[]}}function U1(e,t){if(Ge(t)==="bot")return[];let n=Ge(Zt(ds(t))),s=e.labels.get(n);return s?s.from:null}function B1(e,t,n){return n.some(s=>e.unionOrOneOfIds&&e.unionOrOneOfIds.has(s))&&t.every(s=>s.t==="atom"||s.t==="nom")}function W1(e,t){for(let n of e.nodes.values())for(let[s,{expr:o,from:r}]of Kr(n)){if(o.t!=="or"||n.branchedOn.has(s))continue;let i=[...o.cs].sort((d,p)=>Ge(d).localeCompare(Ge(p)));if(i.some(d=>n.labels.has(Ge(d)))){n.branchedOn.add(s);continue}let a=i.map(d=>({c:d,clashFrom:U1(n,d)})),c=a.filter(d=>d.clashFrom===null).map(d=>d.c),l=a.filter(d=>d.clashFrom!==null).flatMap(d=>d.clashFrom),u=B1(t,i,r)?{cs:i,from:r}:null;return c.length===0?{kind:"clash",clash:{nodeId:n.id,keyA:Ge(i[0]),keyB:Ge(Zt(ds(i[0]))),premises:Wt([...r,...l])},choice:u}:c.length===1?(n.branchedOn.add(s),Wn(n,c[0],[...r,...l]),{kind:"applied",touched:[n.id],choice:u}):(n.branchedOn.add(s),{kind:"split",node:n,from:r,disjuncts:c,choice:u})}return{kind:"none"}}function G1(e,t){for(let n of e.nodes.values())if(!IE(n,e,t))for(let[,{expr:s,from:o}]of Kr(n)){if(s.t!=="some")continue;let r=Ge(s.c);if(Fl(e,t,n.id,s.r).some(c=>e.nodes.get(c.to)?.labels.has(r)))continue;n.successorCount+=1;let a=rm(`${n.id}.${n.successorCount}`,n.id);return Wn(a,s.c,o),e.nodes.set(a.id,a),e.edges.push({from:n.id,r:s.r,to:a.id,fromFacts:o.slice()}),{applied:!0,touched:[a.id]}}return{applied:!1,touched:[]}}function V1(e,t){for(let n of e.nodes.values())for(let[s,{expr:o,from:r}]of Kr(n)){if(o.t!=="atMost")continue;let i=Ge(o.c),a=[...new Set(Fl(e,t,n.id,o.r).map(u=>u.to))].filter(u=>e.nodes.get(u)?.labels.has(i)).sort();if(a.length<=o.n)continue;let c=[];for(let u=0;u<a.length;u+=1)for(let d=u+1;d<a.length;d+=1)c.push([a[u],a[d]]);if(c.length===0){let u=e.nodes.get(a[0])?.labels.get(i)?.from||[];return{kind:"clash",clash:{nodeId:n.id,keyA:s,keyB:`witness(${a[0]})`,premises:Wt([...r,...u])}}}let l=c.filter(([u,d])=>!TE(e,t,u,d));if(l.length===0){let[u,d]=c[0];return{kind:"clash",clash:{nodeId:n.id,keyA:s,keyB:`merge(${u},${d})`,premises:Wt([...r,...AE(e,u,d)])}}}return{kind:"split-merge",pairs:l}}return{kind:"none"}}function H1(e,t){for(let n of e.nodes.values())if(!IE(n,e,t))for(let[,{expr:s,from:o}]of Kr(n)){if(s.t!=="atLeast")continue;let r=Ge(s.c),i=[...new Set(Fl(e,t,n.id,s.r).map(c=>c.to))].filter(c=>e.nodes.get(c)?.labels.has(r)).sort();if(i.length>=s.n)continue;n.successorCount+=1;let a=rm(`${n.id}.${n.successorCount}`,n.id);Wn(a,s.c,o),e.nodes.set(a.id,a),e.edges.push({from:n.id,r:s.r,to:a.id,fromFacts:o.slice()});for(let c of i)L1(e,a.id,c,o);return{applied:!0,touched:[a.id]}}return{applied:!1,touched:[]}}function q1(e,t){for(let n of t){let s=e.nodes.get(n),o=s&&Ml(s);if(o)return o}return null}function Yo(e,t){let n=q1(e,t);return n?{kind:"clash",clash:n}:{kind:"applied"}}function K1(e,t){let n=M1(e);if(n.applied)return Yo(e,n.touched);let s=D1(e,t);if(s.applied)return Yo(e,s.touched);let o=F1(e,t);if(o.kind==="clash")return o;if(o.kind==="merge"){let u=CE(e,t,o.a,o.b);return Yo(e,[u])}let r=z1(e,t);if(r.applied)return Yo(e,r.touched);let i=W1(e,t);if(i.kind==="clash")return i;if(i.kind==="applied")return i.choice&&e.choices.push(i.choice),Yo(e,i.touched);if(i.kind==="split")return i;let a=V1(e,t);if(a.kind==="clash"||a.kind==="split-merge")return a;let c=H1(e,t);if(c.applied)return Yo(e,c.touched);let l=G1(e,t);return l.applied?Yo(e,l.touched):{kind:"done"}}function Y1(e){let t=[...e.nodes.values()].map(s=>({id:s.id,parent:s.parent,labels:[...s.labels.entries()].sort((o,r)=>o[0].localeCompare(r[0])).map(([,{expr:o,from:r}])=>({expr:o,from:r}))})),n=e.edges.map(({from:s,r:o,to:r,fromFacts:i})=>({from:s,r:o,to:r,fromFacts:i.slice()}));return{nodes:t,edges:n}}function X1(e,t,n){let s=nm(n.maxSteps,SE),o=nm(n.maxBranches,jE),r=nm(n.maxNodes,kE),i=[e],a=0,c=1,l=[];for(;i.length;){let u=i.pop();if(u.closed){l.push(u.clash);continue}if(u.nodes.size>r)return{status:"exhausted",reason:"nodes",steps:a,branches:c};for(;;){let d=K1(u,t);if(d.kind==="clash"){let p=d.choice?[...u.choices,d.choice]:u.choices.slice();l.push({...d.clash,choices:p});break}if(d.kind==="applied"){if(a+=1,a>s)return{status:"exhausted",reason:"steps",steps:a,branches:c};if(u.nodes.size>r)return{status:"exhausted",reason:"nodes",steps:a,branches:c};continue}if(d.kind==="split"){if(a+=1,a>s)return{status:"exhausted",reason:"steps",steps:a,branches:c};let p=d.disjuncts.map(f=>{let m=yE(u);d.choice&&m.choices.push(d.choice);let h=m.nodes.get(d.node.id);Wn(h,f,d.from);let g=Ml(h);return g&&(m.closed=!0,m.clash={...g,choices:m.choices.slice()}),m});for(let f=p.length-1;f>=0;f-=1){if(c+=1,c>o)return{status:"exhausted",reason:"branches",steps:a,branches:c};i.push(p[f])}break}if(d.kind==="split-merge"){if(a+=1,a>s)return{status:"exhausted",reason:"steps",steps:a,branches:c};let p=d.pairs.map(([f,m])=>{let h=yE(u),g=CE(h,t,f,m),b=h.nodes.get(g),y=b&&Ml(b);return y&&(h.closed=!0,h.clash={...y,choices:h.choices.slice()}),h});for(let f=p.length-1;f>=0;f-=1){if(c+=1,c>o)return{status:"exhausted",reason:"branches",steps:a,branches:c};i.push(p[f])}break}return{status:"satisfiable",model:Y1(u),steps:a,branches:c}}if(c>o)return{status:"exhausted",reason:"branches",steps:a,branches:c}}return{status:"unsatisfiable",clashes:l,steps:a,branches:c}}function J1(e,t){let n=new Map,s=i=>(n.has(i)||n.set(i,rm(i,null)),n.get(i));for(let i of e.individuals||[])s(i);for(let i of e.assertions||[])Wn(s(i.ind),i.expr,i.from);for(let i of t||[])!i||!i.ind||!i.expr||Wn(s(i.ind),Zt(i.expr),i.from||[]);for(let[i,a]of e.nominalIndividuals||[])Wn(s(i),{t:"nom",ind:i},a);let o=new Map;for(let i of e.differentFrom||[]){if(!i||!i.a||!i.b||i.a===i.b)continue;let a=fa(i.a,i.b),c=o.get(a);o.set(a,Wt(c?[...c,...i.from]:i.from))}let r=[];for(let i of e.roleAssertions||[])s(i.a),s(i.b),r.push({from:i.a,r:i.r,to:i.b,fromFacts:i.from.slice()});return{nodes:n,edges:r,closed:!1,clash:null,inequalityFrom:o,choices:[]}}function im(e,t=[],n={}){let s=J1(e,t);for(let r of s.nodes.values()){let i=Ml(r);if(i){s.closed=!0,s.clash={...i,choices:[]};break}}let o=X1(s,e,n);return o.status==="exhausted"?{satisfiable:null,exhausted:o.reason,steps:o.steps,branches:o.branches}:o.status==="satisfiable"?{satisfiable:!0,model:o.model,steps:o.steps,branches:o.branches}:{satisfiable:!1,closedClashes:o.clashes,steps:o.steps,branches:o.branches}}function am(e,t,n){let s=im(e,t,n);if(s.satisfiable===null)return{status:"exhausted",reason:s.exhausted,steps:s.steps,branches:s.branches};if(s.satisfiable===!1){let o=Wt(s.closedClashes.flatMap(l=>l?.premises||[])),r=new Map;for(let l of s.closedClashes)for(let u of l?.choices||[])for(let d of u.cs)r.set(Ge(d),d);let i=[...r.keys()].sort(),a=i.slice(0,_E).map(l=>r.get(l)),c=i.length;return{status:"proved",premises:o,cases:a,casesTotal:c,steps:s.steps,branches:s.branches}}return{status:"disproved",model:s.model,steps:s.steps,branches:s.branches}}function Q1(e,t,n,s={}){return am(e,[{ind:t,expr:Zt(ds(n)),from:[]}],s)}function Z1(e,t,n,s={}){let o=Zt(vE([ze(t),ds(ze(n))]));return am(e,[{ind:"fresh-0",expr:o,from:[]}],s)}function eP(e,t,n,s={}){let o=Zt(vE([ze(t),ze(n)]));return am(e,[{ind:"fresh-0",expr:o,from:[]}],s)}function tP(e){return e?e.keyA==="bot"?"bottom":`complement:${e.keyA}~${e.keyB}`:"unsatisfiable"}function nP(e){let t=Array.isArray(e)?e.filter(L=>L&&L.subject&&L.predicate):[],n=new Map,s=new Map,o=new Map,r=new Map,i=new Map,a=new Map,c=new Map,l=new Map,u=[],d=[],p=[],f=[],m=new Set,h=[],g=[],b=[],y=[],$=(L,V,W)=>{L.has(V)||L.set(V,[]),L.get(V).push(W)};for(let L of t){let V=String(L.predicate).trim().toLowerCase();V==="owl:onproperty"?n.set(L.subject,{object:L.object,id:L.id}):V==="owl:somevaluesfrom"?s.set(L.subject,{object:L.object,id:L.id}):V==="owl:allvaluesfrom"?o.set(L.subject,{object:L.object,id:L.id}):V==="owl:onclass"?r.set(L.subject,{object:L.object,id:L.id}):V==="owl:mincardinality"?i.set(L.subject,{kind:"min",n:Number(L.object),id:L.id}):V==="owl:maxcardinality"?i.set(L.subject,{kind:"max",n:Number(L.object),id:L.id}):V==="owl:cardinality"?i.set(L.subject,{kind:"exact",n:Number(L.object),id:L.id}):V==="rdfs:subclassof"?u.push(L):V==="owl:disjointwith"?d.push(L):V==="rdf:type"?(p.push(L),String(L.object||"").toLowerCase()==="transitiveproperty"&&m.add(L.subject)):V==="mgxneg:subclassof"?f.push(L):V==="owl:unionof"?$(a,L.subject,L):V==="owl:complementof"?c.set(L.subject,L):V==="rdfs:subpropertyof"?h.push(L):V==="owl:differentfrom"?g.push(L):V==="owl:oneof"?$(l,L.subject,L):V==="owl:inverseof"?b.push(L):y.push(L)}let E=new Set;for(let L of p){let V=String(L.object||"").toLowerCase();sm.has(V)||E.add(L.subject)}let _=EE(E,y),v=L=>_.has(L)||xE.test(L),S=y.filter(L=>v(L.subject)&&v(L.object)).sort((L,V)=>L.subject.localeCompare(V.subject)||L.predicate.localeCompare(V.predicate)||L.object.localeCompare(V.object)).slice(0,RE).map(L=>({a:L.subject,r:L.predicate,b:L.object,from:[L.id]})),C=(L,V,W)=>({sub:L,sup:V,from:Wt(W),disjunction:Zt(tm([ds(L),V]))}),x=[],R=[];for(let L of u){let V=L.object;if(!n.has(V)){x.push(C(ze(L.subject),ze(V),[L.id]));continue}let W=n.get(V),O=s.get(V);if(O){x.push(C(ze(L.subject),_1(W.object,ze(O.object)),[L.id,W.id,O.id]));continue}let D=o.get(V);if(D){x.push(C(ze(L.subject),T1(W.object,ze(D.object)),[L.id,W.id,D.id]));continue}let N=i.get(V),F=r.get(V);if(N&&F){let z=[L.id,W.id,F.id,N.id];N.kind==="min"?x.push(C(ze(L.subject),{t:"atLeast",n:N.n,r:W.object,c:ze(F.object)},z)):N.kind==="max"?x.push(C(ze(L.subject),{t:"atMost",n:N.n,r:W.object,c:ze(F.object)},z)):N.kind==="exact"&&(x.push(C(ze(L.subject),{t:"atLeast",n:N.n,r:W.object,c:ze(F.object)},z)),x.push(C(ze(L.subject),{t:"atMost",n:N.n,r:W.object,c:ze(F.object)},z)))}}for(let L of d)v(L.subject)?R.push({ind:L.subject,expr:Zt(ds(ze(L.object))),from:[L.id]}):x.push(C(ze(L.subject),Zt(ds(ze(L.object))),[L.id]));for(let L of p)sm.has(String(L.object||"").toLowerCase())||R.push({ind:L.subject,expr:ze(L.object),from:[L.id]});for(let L of f)R.push({ind:L.subject,expr:Zt(ds(ze(L.object))),from:[L.id]});for(let[L,V]of a){let W=[...V].sort((F,z)=>String(F.object).localeCompare(String(z.object))),O=W.map(F=>ze(F.object)),D=W.map(F=>F.id),N=Zt(tm(O));x.push(C(ze(L),N,D)),x.push(C(N,ze(L),D))}for(let[L,V]of c){let W=Zt(ds(ze(V.object)));x.push(C(ze(L),W,[V.id])),x.push(C(W,ze(L),[V.id]))}let w=new Map;for(let[L,V]of l){let W=[...V].sort((N,F)=>String(N.object).localeCompare(String(F.object))),O=W.map(N=>({t:"nom",ind:N.object})),D=W.map(N=>N.id);x.push(C(ze(L),Zt(tm(O)),D));for(let N of W){x.push(C({t:"nom",ind:N.object},ze(L),[N.id]));let F=w.get(N.object);w.set(N.object,F?Wt([...F,N.id]):[N.id])}}let T=g.map(L=>({a:L.subject,b:L.object,from:[L.id]})).sort((L,V)=>L.a.localeCompare(V.a)||L.b.localeCompare(V.b)),I=new Map;for(let L of b)I.set(L.subject,L.object),I.has(L.object)||I.set(L.object,L.subject);let j=new Set;for(let{object:L}of n.values())j.add(L);for(let L of S)j.add(L.r);let k=h.map(L=>[L.subject,L.object]).sort((L,V)=>L[0].localeCompare(V[0])||L[1].localeCompare(V[1])),P=new Set([...j,...k.flat(),...I.keys(),...I.values()]),U=I1(k,P);x.sort((L,V)=>Ge(L.sub).localeCompare(Ge(V.sub))||Ge(L.sup).localeCompare(Ge(V.sup))||L.from.join(",").localeCompare(V.from.join(","))),R.sort((L,V)=>L.ind.localeCompare(V.ind)||Ge(L.expr).localeCompare(Ge(V.expr)));let H=[...new Set([...R.map(L=>L.ind),...S.flatMap(L=>[L.a,L.b])])].sort(),X=new Set(H),Q=new Set([...[...a.values()].flatMap(L=>L.map(V=>V.id)),...[...l.values()].flatMap(L=>L.map(V=>V.id))]);return{axioms:x,assertions:R,roles:[...j].sort(),individuals:H,transitiveRoles:m,roleClosure:U,namedIndividuals:X,nominalIndividuals:w,differentFrom:T,inverseOf:I,roleAssertions:S,unionOrOneOfIds:Q}}function sP(e,t){return{axioms:e.axioms,assertions:(e.assertions||[]).filter(n=>n.ind===t),roles:e.roles,individuals:[t],transitiveRoles:e.transitiveRoles,roleAssertions:e.roleAssertions,roleClosure:e.roleClosure,namedIndividuals:e.namedIndividuals,nominalIndividuals:e.nominalIndividuals,differentFrom:e.differentFrom,inverseOf:e.inverseOf,unionOrOneOfIds:e.unionOrOneOfIds}}function oP(e,t=null,n={}){let s=[...new Set(Array.isArray(t)&&t.length?t:e.individuals||[])].sort(),o=[];for(let r of s){let i=sP(e,r);if(!i.assertions.length)continue;let a=im(i,[],n);if(a.satisfiable===null||a.satisfiable===!0)continue;let c=Wt(a.closedClashes.flatMap(l=>l?.premises||[]));o.push({subject:r,premises:c,kind:tP(a.closedClashes[0])})}return o.sort((r,i)=>r.subject.localeCompare(i.subject)),o}function us(e,t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)}function rP(e,t,{hops:n=om}={}){let s=Array.isArray(e)?e.filter(k=>k&&k.subject&&k.predicate):[],o=A1(n,om),r=new Map,i=new Map,a=new Map,c=new Map,l=new Map,u=new Map,d=new Map,p=new Map,f=new Map,m=new Map,h=new Map,g=[],b=new Map,y=new Set;for(let k of s){if(String(k.predicate).trim().toLowerCase()!=="rdf:type")continue;let P=String(k.object||"").toLowerCase();sm.has(P)||y.add(k.subject)}let $=s.filter(k=>!$E.has(String(k.predicate).trim().toLowerCase())),E=EE(y,$),_=k=>E.has(k)||xE.test(k);for(let k of s){let P=String(k.predicate).trim().toLowerCase();P==="rdfs:subclassof"?(us(r,k.subject,k.object),us(i,k.object,k.subject)):P==="owl:onproperty"?a.set(k.subject,k.object):P==="owl:somevaluesfrom"||P==="owl:allvaluesfrom"||P==="owl:onclass"?(c.set(k.subject,k.object),us(l,k.object,k.subject)):P==="owl:unionof"?(us(u,k.subject,k.object),us(d,k.object,k.subject)):P==="owl:complementof"?(p.set(k.subject,k.object),us(f,k.object,k.subject)):P==="owl:oneof"?(us(m,k.subject,k.object),us(h,k.object,k.subject)):!$E.has(P)&&_(k.subject)&&_(k.object)&&(g.push(k),us(b,k.subject,k.object),us(b,k.object,k.subject))}let v=new Map;function S(k){let P=v.get(k);if(P)return P;let U=new Set,H=[...r.get(k)||[],...i.get(k)||[]];for(;H.length;){let X=H.pop();if(!U.has(X)){U.add(X);for(let Q of r.get(X)||[])U.has(Q)||H.push(Q);for(let Q of i.get(X)||[])U.has(Q)||H.push(Q)}}v.set(k,U);for(let X of U)v.has(X)||v.set(X,U);return U}let C=new Set,x=new Map,R=[];function w(k,P){if(!k)return;let U=x.get(k);U!==void 0&&U>=P||(x.set(k,P),R.push({term:k,hopsLeft:P}))}let T=[...new Set((Array.isArray(t)?t:[]).map(k=>q(k)).filter(Boolean))];for(let k of T)w(k,o);let I=0;for(;I<R.length;){let{term:k,hopsLeft:P}=R[I];if(I+=1,x.get(k)===P){C.add(k);for(let U of S(k))C.add(U),w(U,P);if(!(P<=0)){c.has(k)&&w(c.get(k),o);for(let U of l.get(k)||[])w(U,o);for(let U of u.get(k)||[])w(U,P-1);for(let U of d.get(k)||[])w(U,P-1);p.has(k)&&w(p.get(k),P-1);for(let U of f.get(k)||[])w(U,P-1);for(let U of m.get(k)||[])w(U,P-1);for(let U of h.get(k)||[])w(U,P-1);for(let U of b.get(k)||[])w(U,o)}}}let j=new Set;for(let[k,P]of a)C.has(k)&&j.add(fs(P));for(let k of g)(C.has(k.subject)||C.has(k.object))&&j.add(fs(k.predicate));return s.filter(k=>{if(C.has(k.subject)||C.has(k.object))return!0;let P=String(k.predicate).trim().toLowerCase();return P==="rdfs:subpropertyof"||P==="owl:inverseof"||P==="rdf:type"&&String(k.object).toLowerCase()==="transitiveproperty"?j.has(fs(k.subject)):!1})}function aP(e){return(Array.isArray(e)?e:[]).some(n=>{let s=String(n?.predicate||"").trim().toLowerCase();return iP.has(s)?!0:s==="rdf:type"&&String(n?.object||"").toLowerCase()==="transitiveproperty"})}var ze,ds,vE,tm,_1,T1,xE,fs,sm,SE,jE,kE,O1,om,RE,_E,N1,$E,iP,lm=M(()=>{it();ze=e=>({t:"atom",name:e}),ds=e=>({t:"not",c:e}),vE=e=>({t:"and",cs:e}),tm=e=>({t:"or",cs:e}),_1=(e,t)=>({t:"some",r:e,c:t}),T1=(e,t)=>({t:"all",r:e,c:t});xE=/[./\\#:@]/;fs=e=>q(e);sm=new Set(["restriction","transitiveproperty","class"]),SE=5e3,jE=256,kE=512,O1=.95,om=4,RE=256,_E=6,N1=/\.\d+$/;$E=new Set(["owl:onproperty","owl:somevaluesfrom","owl:allvaluesfrom","owl:onclass","owl:mincardinality","owl:maxcardinality","owl:cardinality","rdfs:subclassof","owl:disjointwith","rdf:type","mgxneg:subclassof","owl:unionof","owl:complementof","rdfs:subpropertyof","owl:differentfrom","owl:oneof","owl:inverseof"]);iP=new Set(["owl:unionof","owl:complementof","owl:oneof","owl:allvaluesfrom","owl:mincardinality","owl:maxcardinality","owl:cardinality","rdfs:subpropertyof","owl:inverseof"])});var FE={};Lt(FE,{BOT:()=>un,DEFAULT_EL_BUDGET:()=>mm,DEFAULT_EL_ROUNDS:()=>hm,EL_RESTRICTION_RULE:()=>pm,EL_RULE_CONFIDENCE:()=>um,EL_SUBSUMPTION_RULE:()=>fm,ENTAILED_EL_PROVENANCE:()=>PE,ENTAILED_EL_RESTRICTION_PROVENANCE:()=>ma,TOP:()=>po,classifyEl:()=>xP,elGoalAxioms:()=>NE,elGoalFor:()=>LE,elUnsatisfiableClasses:()=>vP,normalizeElTBox:()=>dm,proveElSubsumption:()=>$P,saturateEl:()=>Dl});function cP(e,t,n){for(let s of t)if(typeof e?.[s]!="function")throw new TypeError(`${n} needs a store option carrying { ${t.join(", ")} } (memory/core.mjs's read/write functions) \u2014 missing ${s}`);return e}function lP(e){if(!e)return null;let t=e instanceof Set?[...e]:Array.isArray(e)?e:[],n=new Set;for(let s of t){let o=q(s);o&&n.add(o)}return n.size?n:null}function dm(e,{budget:t=500}={}){let s=[...(Array.isArray(e)?e:[]).filter(w=>w&&w.id&&w.subject&&w.predicate&&w.object!==void 0&&w.object!==null)].sort((w,T)=>String(w.id).localeCompare(String(T.id))),o=s.length>t,r=o?s.slice(0,t):s,i=new Set,a=new Set,c=w=>{w&&w!==po&&w!==un&&i.add(w)},l=new Map,u=new Map,d=new Map,p=new Map,f=new Map,m=new Map,h=[],g=[],b=new Map,y=[];for(let w of r){if(w.subject===po||w.subject===un||w.object===po||w.object===un)continue;let T=w.predicate;fP(T)?(l.set(w.subject,w),c(w.subject)):pP(T)?(u.set(w.subject,w),c(w.subject),c(w.object)):mP(T)?d.set(w.subject,w):hP(T)?(p.set(w.subject,w),c(w.subject),c(w.object)):yP(T)?(f.set(w.subject,w),c(w.subject)):gP(T)?(m.has(w.subject)||m.set(w.subject,[]),m.get(w.subject).push(w),c(w.subject),c(w.object)):OE(T)?(h.push(w),c(w.subject),c(w.object)):dP(T)?(g.push(w),c(w.subject),c(w.object)):uP(T)&&w.object==="transitiveproperty"?(b.has(w.subject)||b.set(w.subject,w),a.add(w.subject)):bP(T)&&(y.push(w),a.add(w.subject),a.add(w.object))}let $=new Set([...l.keys()].filter(w=>u.has(w))),E=new Set([...l.keys()].filter(w=>d.has(w)));for(let w of E)i.delete(w);let _=new Map;for(let w of $)_.set(w,{role:l.get(w).object,filler:u.get(w).object});let v=new Map;for(let w of Md(r))w.kind!=="min"&&w.kind!=="exactly"||w.n>=1&&($.has(w.restriction)||!l.has(w.restriction)||!p.has(w.restriction)||!f.has(w.restriction)||(v.set(w.restriction,w.onClass),_.set(w.restriction,{role:"has",filler:w.onClass})));let S=new Set(m.keys()),C=[],x=new Map;for(let w of h){let T=w.subject,I=w.object;if(S.has(T)){x.has(T)||x.set(T,w);continue}if($.has(I)){let{role:j,filler:k}=_.get(I),P=l.get(I),U=u.get(I);C.push({form:"someRight",sub:T,role:j,filler:k,from:[w.id,P.id,U.id]}),C.push({form:"someLeft",role:j,filler:k,sup:I,from:[P.id,U.id]});continue}if(v.has(I)){let j=v.get(I),k=l.get(I),P=p.get(I),U=f.get(I);C.push({form:"someRight",sub:T,role:"has",filler:j,from:[w.id,k.id,P.id,U.id]}),C.push({form:"someLeft",role:"has",filler:j,sup:I,from:[k.id,P.id,U.id]});continue}E.has(I)||C.push({form:"sub",sub:T,sup:I,from:[w.id]})}for(let[w,T]of m){let I=x.get(w);if(!I)continue;let j=new Map;for(let H of T)j.has(H.object)||j.set(H.object,H);let k=[...j.keys()].sort();if(k.length<2)continue;let P=k[0],U=[j.get(k[0]).id];for(let H=1;H<k.length;H+=1){let X=k[H],Q=H===k.length-1,L=Q?I.object:`${P}-and-${X}`,V=[P,X].sort(),W=j.get(X).id,O=Q?[...U,W,I.id]:[...U,W];C.push({form:"and",subs:V,sup:L,from:O}),U=[...U,W],P=L}}for(let w of g)C.push({form:"and",subs:[w.subject,w.object].sort(),sup:un,from:[w.id]});let R=[];for(let w of[...b.keys()].sort())R.push({kind:"transitive",role:w,from:[b.get(w).id]});for(let w of[...y].sort((T,I)=>`${T.subject}${ue}${T.object}`.localeCompare(`${I.subject}${ue}${I.object}`)))R.push({kind:"sub",sub:w.subject,sup:w.object,from:[w.id]});return{axioms:C,roleAxioms:R,concepts:i,roles:a,restrictionOf:_,truncated:o}}function Dl(e,{budget:t=2e3,rounds:n=64,focus:s=null}={}){let o=e?.axioms||[],r=e?.roleAxioms||[],i=[...e?.concepts||[]].sort(),a=s instanceof Set?s.size?s:null:lP(s),c=(...w)=>!a||w.some(T=>a.has(T)),l=new Map,u=new Map,d=new Map,p=new Map;for(let w of o)if(w.form==="sub")l.has(w.sub)||l.set(w.sub,[]),l.get(w.sub).push({sup:w.sup,from:w.from});else if(w.form==="and"){let[T,I]=w.subs;for(let[j,k]of[[T,I],[I,T]])u.has(j)||u.set(j,[]),u.get(j).push({other:k,sup:w.sup,from:w.from})}else if(w.form==="someRight")d.has(w.sub)||d.set(w.sub,[]),d.get(w.sub).push({role:w.role,filler:w.filler,from:w.from});else if(w.form==="someLeft"){let T=`${w.role}${ue}${w.filler}`;p.has(T)||p.set(T,[]),p.get(T).push({sup:w.sup,from:w.from})}let f=new Map,m=new Set,h=new Map;for(let w of r)w.kind==="sub"?(f.has(w.sub)||f.set(w.sub,[]),f.get(w.sub).push({sup:w.sup,from:w.from})):w.kind==="transitive"&&(m.add(w.role),h.has(w.role)||h.set(w.role,w.from));let g=new Map;for(let w of i)g.set(w,new Set([w,po]));let b=new Map,y=new Map,$=new Map,E=(w,T)=>w===T?[]:y.get(`${w}${ue}${T}`)||[],_=(w,T)=>$.get(`${w}${ue}${T}`)||[],v=(...w)=>{let T=new Set,I=[];for(let j of w)for(let k of j||[])!k||T.has(k)||(T.add(k),I.push(k));return I},S=0,C=!1,x=0;for(let w=0;w<n;w+=1){x+=1;let T=[];for(let[j,k]of g)for(let P of k)for(let{sup:U,from:H}of l.get(P)||[])k.has(U)||c(j,P,U)&&T.push({kind:"sub",A:j,X:U,from:v(E(j,P),H),sortKey:`1${ue}${j}${ue}${U}${ue}${P}`});for(let[j,k]of g)for(let P of k)for(let{other:U,sup:H,from:X}of u.get(P)||[])k.has(U)&&(k.has(H)||c(j,P,U,H)&&T.push({kind:"sub",A:j,X:H,from:v(E(j,P),E(j,U),X),sortKey:`2${ue}${j}${ue}${H}${ue}${[P,U].sort().join(ue)}`}));for(let[j,k]of g)for(let P of k)for(let{role:U,filler:H,from:X}of d.get(P)||[]){let Q=`${j}${ue}${H}`;(b.get(U)||pa).has(Q)||c(j,P,H)&&T.push({kind:"role",role:U,A:j,B:H,from:v(E(j,P),X),sortKey:`3${ue}${U}${ue}${j}${ue}${H}${ue}${P}`})}for(let[j,k]of b)for(let P of k){let[U,H]=P.split(ue),X=g.get(H)||pa;for(let Q of X)for(let{sup:L,from:V}of p.get(`${j}${ue}${Q}`)||[]){let W=g.get(U);!W||W.has(L)||c(U,H,Q,L)&&T.push({kind:"sub",A:U,X:L,from:v(_(j,P),E(H,Q),V),sortKey:`4${ue}${U}${ue}${L}${ue}${j}${ue}${H}${ue}${Q}`})}}for(let[j,k]of b)for(let P of k){let[U,H]=P.split(ue);if(!(g.get(H)||pa).has(un))continue;let X=g.get(U);!X||X.has(un)||c(U,H)&&T.push({kind:"sub",A:U,X:un,from:v(_(j,P),E(H,un)),sortKey:`5${ue}${U}${ue}${j}${ue}${H}`})}for(let[j,k]of b)for(let{sup:P,from:U}of f.get(j)||[])for(let H of k){if((b.get(P)||pa).has(H))continue;let[X,Q]=H.split(ue);c(X,Q)&&T.push({kind:"role",role:P,A:X,B:Q,from:v(_(j,H),U),sortKey:`6${ue}${P}${ue}${X}${ue}${Q}${ue}${j}`})}for(let j of[...m].sort()){let k=b.get(j);if(k)for(let P of k){let[U,H]=P.split(ue);for(let X of k){let[Q,L]=X.split(ue);if(Q!==H)continue;let V=`${U}${ue}${L}`;k.has(V)||c(U,H,L)&&T.push({kind:"role",role:j,A:U,B:L,from:v(_(j,P),_(j,X),h.get(j)),sortKey:`7${ue}${j}${ue}${U}${ue}${L}${ue}${H}`})}}}if(!T.length){C=!0;break}T.sort((j,k)=>j.sortKey<k.sortKey?-1:j.sortKey>k.sortKey?1:0);let I=!1;for(let j of T){if(S>=t)break;if(j.kind==="sub"){let k=g.get(j.A);if(!k||k.has(j.X))continue;k.add(j.X),y.set(`${j.A}${ue}${j.X}`,j.from),S+=1,I=!0}else{b.has(j.role)||b.set(j.role,new Set);let k=b.get(j.role),P=`${j.A}${ue}${j.B}`;if(k.has(P))continue;k.add(P),$.set(`${j.role}${ue}${P}`,j.from),S+=1,I=!0}}if(S>=t)break;if(!I){C=!0;break}}let R=[...g.entries()].filter(([,w])=>w.has(un)).map(([w])=>w).sort();return{subsumers:g,roleEdges:b,unsatisfiable:R,derivationOf:y,rounds:x,truncated:!C}}function NE(e,t,{budget:n=200}={}){let o=[...(e?.axioms||[]).filter(a=>a.form==="someRight")].sort((a,c)=>{let l=`${a.role}${ue}${a.filler}${ue}${a.sub}`,u=`${c.role}${ue}${c.filler}${ue}${c.sub}`;return l<u?-1:l>u?1:0}),r=[],i=new Set;for(let a of o){let l=[...t?.get(a.filler)||new Set([a.filler,po])].filter(u=>u!==po&&u!==un).sort();for(let u of l){let d=`some-${a.role}-${u}`;if(!i.has(d)&&(i.add(d),r.push({form:"someLeft",role:a.role,filler:u,sup:d,from:[]}),r.length>=n))return r}}return r}function LE(e,t){let n=q(e),s=q(t),o=`some-${n}-${s}`;return{axiom:{form:"someLeft",role:n,filler:s,sup:o,from:[]},name:o}}function $P(e,t,{role:n,filler:s},{budget:o=2e3,rounds:r=64}={}){let i=q(t),a=dm(e,{budget:o}),{axiom:c,name:l}=LE(n,s),u=new Set(a.concepts);u.add(i),u.add(c.filler);let d={...a,axioms:[...a.axioms,c],concepts:u},p=Dl(d,{budget:o,rounds:r});return(p.subsumers.get(i)||pa).has(l)?{proved:!0,premises:p.derivationOf.get(`${i}${ue}${l}`)||[]}:{proved:!1,exhausted:p.truncated}}function ME(e,{budget:t=mm,rounds:n=hm,focus:s=null}={}){let o=dm(e,{budget:t}),r=Dl(o,{budget:t,rounds:n,focus:s}),i=NE(o,r.subsumers),a=new Map(i.map(d=>[d.sup,{role:d.role,filler:d.filler}])),c={...o,axioms:[...o.axioms,...i]},l=Dl(c,{budget:t,rounds:n,focus:s}),u=o.truncated||r.truncated||l.truncated;return{normalized:o,goals:i,goalInfo:a,finalPass:l,truncated:u}}function vP(e,t={}){let{finalPass:n,truncated:s}=ME(e,t);return{unsatisfiable:n.unsatisfiable,premisesOf:o=>n.derivationOf.get(`${o}${ue}${un}`)||[],truncated:s}}async function xP(e,{budget:t=mm,rounds:n=hm,focus:s=null,maxEnvironments:o=xr,store:r}={}){let{loadMemory:i,readFactRows:a,appendFacts:c}=cP(r,["loadMemory","readFactRows","appendFacts"],"classifyEl"),l=await i(e),u=a(l),{normalized:d,goals:p,goalInfo:f,finalPass:m,truncated:h}=ME(u,{budget:t,rounds:n,focus:s}),g=new Map;for(let R of u)g.set(`${R.subject}${ue}${R.predicate}${ue}${R.object}`,R.trust);let b=new Map(u.map(R=>[R.id,R])),y=R=>(R||[]).map(w=>b.get(w)?.trust).filter(w=>typeof w=="number"),$=new Set(u.filter(R=>OE(R.predicate)).map(R=>`${R.subject}${ue}${R.object}`)),E=[],_=[],v=new Set,S=[...m.subsumers.keys()].sort();for(let R of S){let w=m.subsumers.get(R);if(w.has(un))continue;let T=[...w].filter(I=>I!==R&&I!==po&&I!==un).sort();for(let I of T){let j=`${R}${ue}${I}`;if($.has(j))continue;let k=m.derivationOf.get(j)||[],P=f.get(I);if(P){v.has(I)||(v.add(I),E.push({subject:I,predicate:Dt,object:"owl:Restriction",provenance:ma,justification:[k]}),E.push({subject:I,predicate:Rn,object:P.role,provenance:ma,justification:[k]}),E.push({subject:I,predicate:_n,object:P.filler,provenance:ma,justification:[k]}));let U=y(k),H=E.length;E.push({subject:R,predicate:Be,object:I,provenance:ma,justification:[k],...U.length?{premiseTrusts:U,ruleConfidence:um}:{}}),_.push({toWriteIndex:H,subject:R,object:I,rule:pm})}else if(d.concepts.has(I)){let U=y(k),H=E.length;E.push({subject:R,predicate:Be,object:I,provenance:PE,justification:[k],...U.length?{premiseTrusts:U,ruleConfidence:um}:{}}),_.push({toWriteIndex:H,subject:R,object:I,rule:fm})}}}let{ids:C}=await c(e,E),x=_.map(R=>({id:C[R.toWriteIndex],subject:R.subject,object:R.object,rule:R.rule}));return{derived:x,count:x.length,budget:t,rounds:n,truncated:h,unsatisfiable:m.unsatisfiable,goalCount:p.length}}var ue,po,un,ps,OE,uP,dP,fP,pP,mP,hP,gP,bP,wP,yP,pa,fm,PE,pm,ma,um,mm,hm,DE=M(()=>{it();Ot();ue="\u241F",po="top",un="bot";ps=e=>String(e||"").trim().toLowerCase(),OE=e=>ps(e)==="rdfs:subclassof",uP=e=>ps(e)==="rdf:type",dP=e=>ps(e)==="owl:disjointwith",fP=e=>ps(e)==="owl:onproperty",pP=e=>ps(e)==="owl:somevaluesfrom",mP=e=>ps(e)==="owl:allvaluesfrom",hP=e=>ps(e)==="owl:onclass",gP=e=>ps(e)==="owl:intersectionof",bP=e=>ps(e)==="rdfs:subpropertyof",wP=new Set(["owl:cardinality","owl:mincardinality","owl:maxcardinality"]),yP=e=>wP.has(ps(e));pa=new Set;fm="elSubsumption",PE=`entailed:${fm}`,pm="elRestriction",ma=`entailed:${pm}`,um=.95,mm=2e3,hm=64});var zE={};Lt(zE,{DEFAULT_REASONING_CONFIG:()=>zl,resolveReasoningConfig:()=>RP});function jP(e,t){let n=Number(e);return Number.isInteger(n)&&n>0?n:t}function kP(e,t){return typeof e=="boolean"?e:t}function RP(e){let t=e?.reasoning||{},n={...zl};for(let[s,o]of Object.entries(EP))t[s]!==void 0&&(n[o]=jP(t[s],zl[o]));for(let[s,o]of Object.entries(SP))t[s]!==void 0&&(n[o]=kP(t[s],zl[o]));return n}var zl,EP,SP,UE=M(()=>{zl=Object.freeze({syllogiseBudget:50,syllogiseDepth:32,classifyBudget:2e3,classifyRounds:64,maxEnvironments:4,proveSteps:5e3,proveBranches:256,proveNodes:512,askProveFallback:!0,askProveSteps:1e3,askProveBranches:64,askProveNodes:128}),EP=Object.freeze({syllogise_budget:"syllogiseBudget",syllogise_depth:"syllogiseDepth",classify_budget:"classifyBudget",classify_rounds:"classifyRounds",max_environments:"maxEnvironments",prove_steps:"proveSteps",prove_branches:"proveBranches",prove_nodes:"proveNodes",ask_prove_steps:"askProveSteps",ask_prove_branches:"askProveBranches",ask_prove_nodes:"askProveNodes"}),SP=Object.freeze({ask_prove_fallback:"askProveFallback"})});function km(e){if(!e)return null;let{node:t,shape:n,kind:s}=e;if(t==="find")return`locate a specific named entity ("${e.term}")`;if(t==="count")return`get a count of ${Ul(e.entityType)}`;if(t==="list")return`list/enumerate ${Ul(e.entityType)} matching a condition`;if(t==="superlative")return`rank/compare ${Ul(e.entityType)} by ${e.metricNoun||e.metric||"a metric"}`;if(t==="anaphora")return"follow up on the previous answer's result set (discourse anaphora)";if(t==="membership")return`understand "${e.term||"an entity"}"'s membership/relationship`;if(t==="clause")return km(e.clause);if(t==="miss")return null;if(t==="boolean"||t==="qualifier"||t==="reverseSet"||t==="forwardSet"||t==="allOfClass"||t==="temporal"){let o=s||e.inner?.kind;return o&&Nn[o]?Nn[o]:`filter/traverse ${Ul(e.entityType)} by a relationship`}return n==="meta"?`understand a vocabulary/definition term ("${e.object}")`:n==="where"?`locate where something is defined ("${e.object}")`:n==="when"?"understand when something last changed (history)":n==="whoLast"?"find who most recently touched something (history)":n==="mentions"?`find where something is mentioned in prose ("${e.object}")`:n==="ask"?s&&Nn[s]||"check a specific subject/object relationship":(n==="reverse"||n==="forward")&&s?Nn[s]||`understand a "${s}" relationship`:"understand a graph relationship"}function Im(e){let t=new Map;for(let n of e)t.has(GE(n))||t.set(GE(n),n);return t}function bm(e,t=Jo){let n=[],s=[];for(let c of e)c.predicate===t&&(s.push([c.subject,c.object]),Xo(c)&&n.push([c.subject,c.object]));let o=new Map,r=new Map,i=new Set,a=(c,l,u)=>{!l||!u||l===u||(c.has(l)||c.set(l,new Set),c.get(l).add(u))};for(let[c,l]of s)a(r,c,l),l&&i.add(l);for(let[c,l]of n)a(o,c,l);return{strictEdges:n,broadEdges:s,strictSucc:o,broadSucc:r,reachableHeads:i}}function wm(e,t,n,s,o){let r=s.reachableHeads,i=!1;for(let a of n)if(r.has(a)){i=!0;break}return i?e(t,n,[],s.strictSucc,o)||e(t,n,[],s.broadSucc,o):null}function LP(e,t){return!/ves$/i.test(e)||!/fe?$/i.test(t)?t:e.slice(0,-1)}async function PP(e){let t=String(e||"").toLowerCase();try{let{proseLemma:n}=await Promise.resolve().then(()=>(mE(),pE)),s=n();return s?LP(t,s(t)):t}catch{return t}}function Nm(e){let t=String(e||"").trim();if(/[a-z]ies$/i.test(t))return`${t.slice(0,-3)}y`;if(/[a-z]ses$/i.test(t)){let n=t.slice(0,-2);return/ss$/i.test(n)||MP.has(n.toLowerCase())?n:t.slice(0,-1)}return/(xes|zes|ches|shes)$/i.test(t)?t.slice(0,-2):/[a-z]s$/i.test(t)&&!/(?:ss|ous)$/i.test(t)?t.slice(0,-1):t}async function ql(e){let t=String(e||"").toLowerCase();if(t==="has"||t==="have")return Mr;if(t==="can")return"mgx:capableOf";try{let n=await PP(t);return n==="have"?Mr:Zn(`mgx:${n}`)}catch{return Zn(`mgx:${t}`)}}function GP(e,t){let n=String(t||"").match(WP);return n&&/^mgx:[a-z]+$/.test(e)?{predicate:`${e}-${n[1].toLowerCase()}`,object:n[2].trim()}:{predicate:e,object:String(t||"").trim()}}async function ha(e,t){if(!e||!t)return null;try{let{resolveObject:n}=await Promise.resolve().then(()=>(Jn(),Xb)),s=n(e,t);if(s?.match?.id&&!s.ambiguous)return{id:s.match.id,label:s.match.label}}catch{}return null}function qE(e){return e.predicate===OP&&e.object==="transitiveproperty"||e.predicate===bS}function XP(e){let t=String(e||"");return/^have$/i.test(t)?"has":/[a-z]y$/i.test(t)&&!/[aeiou]y$/i.test(t)?`${t.slice(0,-1)}ies`:/(?:s|x|z|ch|sh|o)$/i.test(t)?`${t}es`:`${t}s`}function Ql(e){let t=String(e||"");return/^has$/i.test(t)?"have":/[a-z]ies$/i.test(t)&&!/[aeiou]ies$/i.test(t)?`${t.slice(0,-3)}y`:/(?:s|x|z|ch|sh|o)es$/i.test(t)?t.slice(0,-2):t.replace(/s$/i,"")}function YE(e){let t=Ql(e);return/[^aeiou]e$/i.test(t)&&t.length>2?`${t.slice(0,-1)}ing`:`${t}ing`}function ES(e){if(Fs[e])return Fs[e];let t=String(e||""),n=$w(t);if(n){let a=ES(n);if(a==="can")return"cannot";if(a==="can be")return"cannot be";if(a==="is"||a.startsWith("is "))return`is not${a.slice(2)}`;let[c,...l]=a.split(" ");return["does not",Ql(c),...l].join(" ")}let s=/^mgx:([a-z]+(?:-[a-z]+)*)-than$/i.exec(t);if(s)return`is ${s[1].replace(/-/g," ")} than`;let o=new RegExp(`^mgx:(${Lm})-([a-z]+)$`,"i").exec(t);if(o)return`is ${o[1].toLowerCase()} ${o[2].toLowerCase()}`;let r=/^mgx:same-([a-z]+)-as$/i.exec(t);if(r)return`has the same ${r[1].toLowerCase()} as`;let i=/^mgx:([a-z]+)(?:-([a-z]+))?$/i.exec(t);return i?`${XP(i[1])}${i[2]?` ${i[2]}`:""}`:e}function xm(e){let t=/^mgx:([a-z][\w-]*)$/i.exec(String(e||""));return t?t[1].toLowerCase():null}function QP(e){let t=String(e||"").trim(),n=t.toLowerCase();for(let{marker:s,predicate:o}of JP)if(n!==s&&n.endsWith(` ${s}`)){let r=t.slice(0,t.length-s.length).trim();if(r)return{subject:r,predicate:o}}return{subject:t,predicate:null}}function ms(e){return e.replace(/#node:[0-9a-f]+/g,"")}function oe(e){let t=e.provenance?` (source: ${ms(e.provenance)})`:"";return e.predicate===bS?`${YE(e.subject)} implies ${YE(e.object)}${t}`:e.provenance.includes("ace:chat")||e.provenance.includes("teach:chat")?`you told me: ${en(e)}${t}`:e.provenance.includes("corpus-weak:")?`possibly: ${en(e)}${t}`:e.provenance.includes("corpus:")?`${en(e)}${t}`:e.provenance.includes("reference:")?`${en(e)}${t}`:`i learned: ${en(e)}${t}`}function XE(e,t,n,{toward:s=null}={}){let o=oe(e);if(!Ln.has(e.predicate)||!n.has(e.subject))return o;let r=hl(e.object,t,{cap:6,stopAt:pl,toward:s});if(r.length<=1)return o;let i=` \u2192 ${r.slice(1).join(" \u2192 ")}`,a=o.match(ZP);return a?o.slice(0,a.index)+i+a[0]:o+i}function JE(e,t,n,{indent:s=""}={}){let o=t.filter(_=>_.predicate===Jo).map(_=>[_.subject,_.object]),r=oa(o),i=e.map(_=>`${s}${XE(_,r,n)}`),a=e.filter(_=>Ln.has(_.predicate)&&n.has(_.subject)),c=[...new Set(a.map(_=>_.object))];if(c.length<2)return{lines:i,grouped:null};let l=t.filter(_=>_.predicate==="owl:disjointWith").map(_=>[_.subject,_.object]),{split:u,clusters:d}=gl(c,{parents:r,disjointEdges:l});if(!u)return{lines:i,grouped:null};let p=a[0].subject,f=new Map;for(let _ of d)for(let v of _.objects)f.set(v,_);let m=e.filter(_=>!(Ln.has(_.predicate)&&n.has(_.subject))),h=[],g=[],b=0,y=_=>{let v=XE(_,r,n);return b<Re?(b+=1,`${s}${v}`):(g.push(v),null)};for(let _ of d){let v=a.filter(S=>f.get(S.object)===_).map(y).filter(Boolean);v.length&&h.push(`${s}${p}, the ${_.label}:
173
173
  ${v.join(`
174
174
  `)}`)}if(m.length){let _=m.map(y).filter(Boolean);_.length&&h.push(`${s}also about ${p}:
175
175
  ${_.join(`
176
176
  `)}`)}let $=g.length?`
177
177
  ${s}\u2026and ${g.length} more \u2014 say 'more' to see them.`:"",E={text:h.join(`
178
- `)+$,replace:!0,...g.length?{pending:{items:g,noun:"facts"}}:{}};return{lines:i,grouped:E}}async function GP(e,t,n,s){let o;try{({digestTermFromRows:o}=await Promise.resolve().then(()=>(fE(),dE)))}catch{return null}let r;try{r=o(e,t,n)}catch{return null}if(!r||!r.paragraphs.length)return null;let i=[...new Set((r.sources||[]).map(u=>u.provenance).filter(Boolean))],a=i.length?`(sources: ${i.join("; ")})
178
+ `)+$,replace:!0,...g.length?{pending:{items:g,noun:"facts"}}:{}};return{lines:i,grouped:E}}async function tM(e,t,n,s){let o;try{({digestTermFromRows:o}=await Promise.resolve().then(()=>(gE(),hE)))}catch{return null}let r;try{r=o(e,t,n)}catch{return null}if(!r||!r.paragraphs.length)return null;let i=[...new Set((r.sources||[]).map(u=>u.provenance).filter(Boolean))],a=i.length?`(sources: ${i.join("; ")})
179
179
  `:"",c=`Say 'show the facts' for all ${s.length} stored facts.`;return{text:`${r.paragraphs.join(`
180
180
 
181
181
  `)}
182
182
 
183
- ${a}${c}`,pending:{items:s,noun:"facts"}}}function Jo(e){let t=Jc().find(n=>n.kind==="article");return t&&cp(String(e||""),t)?"an":"a"}function $S(e,t){return e&&t?{text:`you've told me both, and I won't pick between them \u2014 ${oe(e)}; ${oe(t)}. To settle it, say "forget that ${e.subject} is ${Jo(e.object)} ${e.object}".`,replace:!0}:t?{text:`no \u2014 ${oe(t)}`,replace:!0}:e?{text:`yes \u2014 ${oe(e)}`,replace:!0}:null}function VP(e,t){let n=s=>`${Zt(s)}${s.provenance?` (source: ${ms(s.provenance)})`:""}`;return{text:`you've told me both ${n(e)} and ${n(t)} \u2014 together those contradict, and I won't derive an answer from an inconsistency. To settle it, say "forget that ${e.subject} is ${Jo(e.object)} ${e.object}".`,replace:!0}}function zl(e){let t=o=>`${Zt(o)}${o.provenance?` (source: ${ms(o.provenance)})`:""}`,n=e[0],s=e[e.length-1];return`${e.map(t).join("; ")}; so ${n.subject} is a ${s.object}`}async function Ul(e){try{let{loadMemory:t}=await Promise.resolve().then(()=>(qe(),Ms)),n=await t(e),s=[];for(let o of n.individuals||[]){if(o?.class!=="Fact")continue;let r=i=>(o.attributes||[]).find(a=>a.key===i)?.value||"";s.push({subject:r("subject"),predicate:r("predicate"),object:r("object"),provenance:r("provenance")})}return s}catch{return[]}}async function nt(e,t=null){if(t?.rows)return t.rows;try{let{loadMemory:n,readFactRows:s}=await Promise.resolve().then(()=>(qe(),Ms)),o=s(await n(e));return t&&(t.rows=o,t.reloads=(t.reloads||0)+1),o}catch{return[]}}function HP(e){if(!Bl)try{Bl=wn().nounPlurals}catch{Bl=new Map}return Bl.get(e)??null}function ql(e){let t=String(e||"").trim().toLowerCase();if(!t||/\s/.test(t))return t;try{return Cn(wn(),t)?.lemma||t}catch{return t}}function qP(e){let t=String(e||"").trim().match(/^(?:all|every|each|both|most|some)\s+([\w-]+)$/i);if(!t)return ql(e);let n=ql(Cm(t[1]));return`${Jo(n)} ${n}`}function ee(e,t){let n=e(t),s=new Set,o=new Set([n]),r=n.replace(KP,"").trim();r&&r!==n&&o.add(r);for(let i of o){s.add(i),i.endsWith("es")&&s.add(i.slice(0,-2)),i.endsWith("s")&&s.add(i.slice(0,-1));let a=HP(i);a&&s.add(e(a))}return s}function KE(e,t,n){for(let s of e)for(let o of t){let r=n(s,o);if(r)return r}return null}function ES(e,t=null){let n=Kl(e),s=n.match(YP);if(s)return[s[0],s[2],s[1]];if(!t)return null;let o=n.match(JP);return o&&t(o[1])?[o[0],o[2],o[1]]:null}function jm(e){let t=String(e||"").replace(eM,"");if(t!==e){let s=t.match(po);if(s)return s}let n=String(e||"").match(tM);return n?`is ${n[1].trim()} a ${n[2].trim()}`.match(po):null}function sM(e,t,n){let s=String(e||"").trim().split(/\s+/).filter(Boolean);if(s.length<2)return null;let o=t.filter(r=>On.has(r.predicate));if(!o.length)return null;for(let r=1;r<s.length;r+=1){let i=ee(n,s.slice(0,r).join(" ")),a=s.slice(r).join(" "),c=ee(n,a);if(o.some(l=>c.has(l.subject)&&i.has(l.object)))return a}return null}function SS(e,t,n){if(t.has(n))return!0;for(let s of ee(e,n))if(t.has(s))return!0;return!1}function jS(e,t,n,s){let o=a=>a.predicate===Gl&&s(a.object)===n||a.predicate===`tmct:${n}`&&a.object==="true",r=(a,c)=>SS(s,a,c.subject),i=e.find(a=>r(t,a)&&o(a));if(i)return[i];for(let a of e.filter(c=>On.has(c.predicate)&&r(t,c))){let c=ee(s,a.object),l=e.find(u=>r(c,u)&&o(u));if(l)return[a,l]}return null}function cM(e,t,n,s){let o=a=>a.predicate==="mgx:capableOf"&&n.has(s(a.object)),r=(a,c)=>SS(s,a,c.subject),i=e.find(a=>r(t,a)&&o(a));if(i)return[i];for(let a of e.filter(c=>On.has(c.predicate)&&r(t,c))){let c=ee(s,a.object),l=e.find(u=>r(c,u)&&o(u));if(l)return[a,l]}return null}function lM(e){let t=String(e??"").trim().match(/^([\w-]+)\s+(\S.*)$/);if(!t)return null;let n=Hi(t[1]);return n===null?null:{count:n,part:t[2]}}function Hl(e){return String(e||"").replace(/^(?:can't|cannot|can not|cant)\s+/i,"can ").replace(/^(?:doesn't|does not)\s+/i,"does ").replace(/^(?:don't|do not)\s+/i,"do ").replace(/^(?:didn't|did not)\s+/i,"did ").replace(/\s+(?:not|never)\s+/i," ").replace(/\s+/g," ").trim()}function JE(e){let t=String(e.text||"").replace(/^(?:yes|no) — /i,"");return t===e.text?e:{...e,text:t}}function EM(e,t){let n=(e||[]).map(s=>t.find(o=>o.predicate===s.predicate&&o.subject===s.subject&&o.object===s.object));return!n.length||!n.every(Boolean)?null:n.map(s=>`${Zt(s)}${s.provenance?` (source: ${ms(s.provenance)})`:""}`).join("; ")}function ZE(e,t,n,{maxHops:s=3}={}){let o=ee(q,e),r=ee(q,t),i=ac(o,r,n,{maxHops:s}),a=c=>{let l=c&&c.length?EM(c,n):null;return l?` \u2014 via: ${l}`:""};if(i.verdict==="both")return{text:`I have both, at the same level of detail \u2014 my sources disagree, so I won't pick:
183
+ ${a}${c}`,pending:{items:s,noun:"facts"}}}function Qo(e){let t=Zc().find(n=>n.kind==="article");return t&&dp(String(e||""),t)?"an":"a"}function SS(e,t){return e&&t?{text:`you've told me both, and I won't pick between them \u2014 ${oe(e)}; ${oe(t)}. To settle it, say "forget that ${e.subject} is ${Qo(e.object)} ${e.object}".`,replace:!0}:t?{text:`no \u2014 ${oe(t)}`,replace:!0}:e?{text:`yes \u2014 ${oe(e)}`,replace:!0}:null}function nM(e,t){let n=s=>`${en(s)}${s.provenance?` (source: ${ms(s.provenance)})`:""}`;return{text:`you've told me both ${n(e)} and ${n(t)} \u2014 together those contradict, and I won't derive an answer from an inconsistency. To settle it, say "forget that ${e.subject} is ${Qo(e.object)} ${e.object}".`,replace:!0}}function Bl(e){let t=o=>`${en(o)}${o.provenance?` (source: ${ms(o.provenance)})`:""}`,n=e[0],s=e[e.length-1];return`${e.map(t).join("; ")}; so ${n.subject} is a ${s.object}`}async function Wl(e){try{let{loadMemory:t}=await Promise.resolve().then(()=>(qe(),Ms)),n=await t(e),s=[];for(let o of n.individuals||[]){if(o?.class!=="Fact")continue;let r=i=>(o.attributes||[]).find(a=>a.key===i)?.value||"";s.push({subject:r("subject"),predicate:r("predicate"),object:r("object"),provenance:r("provenance")})}return s}catch{return[]}}async function nt(e,t=null){if(t?.rows)return t.rows;try{let{loadMemory:n,readFactRows:s}=await Promise.resolve().then(()=>(qe(),Ms)),o=s(await n(e));return t&&(t.rows=o,t.reloads=(t.reloads||0)+1),o}catch{return[]}}function sM(e){if(!Gl)try{Gl=$n().nounPlurals}catch{Gl=new Map}return Gl.get(e)??null}function Yl(e){let t=String(e||"").trim().toLowerCase();if(!t||/\s/.test(t))return t;try{return On($n(),t)?.lemma||t}catch{return t}}function oM(e){let t=String(e||"").trim().match(/^(?:all|every|each|both|most|some)\s+([\w-]+)$/i);if(!t)return Yl(e);let n=Yl(Nm(t[1]));return`${Qo(n)} ${n}`}function ee(e,t){let n=e(t),s=new Set,o=new Set([n]),r=n.replace(rM,"").trim();r&&r!==n&&o.add(r);for(let i of o){s.add(i),i.endsWith("es")&&s.add(i.slice(0,-2)),i.endsWith("s")&&s.add(i.slice(0,-1));let a=sM(i);a&&s.add(e(a))}return s}function QE(e,t,n){for(let s of e)for(let o of t){let r=n(s,o);if(r)return r}return null}function RS(e,t=null){let n=Xl(e),s=n.match(iM);if(s)return[s[0],s[2],s[1]];if(!t)return null;let o=n.match(cM);return o&&t(o[1])?[o[0],o[2],o[1]]:null}function _m(e){let t=String(e||"").replace(dM,"");if(t!==e){let s=t.match(mo);if(s)return s}let n=String(e||"").match(fM);return n?`is ${n[1].trim()} a ${n[2].trim()}`.match(mo):null}function mM(e,t,n){let s=String(e||"").trim().split(/\s+/).filter(Boolean);if(s.length<2)return null;let o=t.filter(r=>Ln.has(r.predicate));if(!o.length)return null;for(let r=1;r<s.length;r+=1){let i=ee(n,s.slice(0,r).join(" ")),a=s.slice(r).join(" "),c=ee(n,a);if(o.some(l=>c.has(l.subject)&&i.has(l.object)))return a}return null}function _S(e,t,n){if(t.has(n))return!0;for(let s of ee(e,n))if(t.has(s))return!0;return!1}function TS(e,t,n,s){let o=a=>a.predicate===Hl&&s(a.object)===n||a.predicate===`tmct:${n}`&&a.object==="true",r=(a,c)=>_S(s,a,c.subject),i=e.find(a=>r(t,a)&&o(a));if(i)return[i];for(let a of e.filter(c=>Ln.has(c.predicate)&&r(t,c))){let c=ee(s,a.object),l=e.find(u=>r(c,u)&&o(u));if(l)return[a,l]}return null}function yM(e,t,n,s){let o=a=>a.predicate==="mgx:capableOf"&&n.has(s(a.object)),r=(a,c)=>_S(s,a,c.subject),i=e.find(a=>r(t,a)&&o(a));if(i)return[i];for(let a of e.filter(c=>Ln.has(c.predicate)&&r(t,c))){let c=ee(s,a.object),l=e.find(u=>r(c,u)&&o(u));if(l)return[a,l]}return null}function $M(e){let t=String(e??"").trim().match(/^([\w-]+)\s+(\S.*)$/);if(!t)return null;let n=Yi(t[1]);return n===null?null:{count:n,part:t[2]}}function Kl(e){return String(e||"").replace(/^(?:can't|cannot|can not|cant)\s+/i,"can ").replace(/^(?:doesn't|does not)\s+/i,"does ").replace(/^(?:don't|do not)\s+/i,"do ").replace(/^(?:didn't|did not)\s+/i,"did ").replace(/\s+(?:not|never)\s+/i," ").replace(/\s+/g," ").trim()}function tS(e){let t=String(e.text||"").replace(/^(?:yes|no) — /i,"");return t===e.text?e:{...e,text:t}}function NM(e,t){let n=(e||[]).map(s=>t.find(o=>o.predicate===s.predicate&&o.subject===s.subject&&o.object===s.object));return!n.length||!n.every(Boolean)?null:n.map(s=>`${en(s)}${s.provenance?` (source: ${ms(s.provenance)})`:""}`).join("; ")}function sS(e,t,n,{maxHops:s=3}={}){let o=ee(q,e),r=ee(q,t),i=lc(o,r,n,{maxHops:s}),a=c=>{let l=c&&c.length?NM(c,n):null;return l?` \u2014 via: ${l}`:""};if(i.verdict==="both")return{text:`I have both, at the same level of detail \u2014 my sources disagree, so I won't pick:
184
184
  ${[...i.negative,...i.positive].map(oe).join(`
185
- `)}`,replace:!0,miss:!0};if(i.verdict==="yes"||i.verdict==="no"){let c=i.verdict==="no"?i.negative[0]:i.positive[0],l=`${i.verdict} \u2014 ${oe(c)}${a(i.chain)}`;return i.overrides&&(l+=`. That overrides what I know about ${i.overrides.fact.subject} generally: ${oe(i.overrides.fact)}`),{text:l,replace:!0}}return null}function eS(e,t,n,{maxHops:s=3}={}){let o=ee(q,e),r=ee(q,t),i=Ud(o,r,n,{maxHops:s});if(!i)return null;let a=`${e} is a kind of ${i.klass}`,c=`I don't know if ${e} can ${t}.`;if(i.positive.length||i.negative.length){let u=[`${i.positive.length} can ${t}`,`${i.negative.length} cannot`,`${i.unknown.length} I have nothing on`].join(", "),d=[...i.positive,...i.negative].slice(0,zd).map(p=>oe(p.fact));return{text:`${c} ${a}, and of the ${i.kinds} kind${i.kinds===1?"":"s"} of ${i.klass} I know, ${u}.
185
+ `)}`,replace:!0,miss:!0};if(i.verdict==="yes"||i.verdict==="no"){let c=i.verdict==="no"?i.negative[0]:i.positive[0],l=`${i.verdict} \u2014 ${oe(c)}${a(i.chain)}`;return i.overrides&&(l+=`. That overrides what I know about ${i.overrides.fact.subject} generally: ${oe(i.overrides.fact)}`),{text:l,replace:!0}}return null}function oS(e,t,n,{maxHops:s=3}={}){let o=ee(q,e),r=ee(q,t),i=Gd(o,r,n,{maxHops:s});if(!i)return null;let a=`${e} is a kind of ${i.klass}`,c=`I don't know if ${e} can ${t}.`;if(i.positive.length||i.negative.length){let u=[`${i.positive.length} can ${t}`,`${i.negative.length} cannot`,`${i.unknown.length} I have nothing on`].join(", "),d=[...i.positive,...i.negative].slice(0,Wd).map(p=>oe(p.fact));return{text:`${c} ${a}, and of the ${i.kinds} kind${i.kinds===1?"":"s"} of ${i.klass} I know, ${u}.
186
186
  ${d.join(`
187
- `)}`,replace:!0,miss:!0}}let l=Bd(r,n,{exclude:new Set([...o,i.klass])});if(l.length){let u=l.slice(0,zd),d=l.slice(u.length);return{text:`${c} ${a}, and nothing I know about ${i.klass} says whether one can ${t}. I do know ${l.length} thing${l.length===1?"":"s"} that can ${t}${d.length?` (first ${u.length} shown)`:""}:
187
+ `)}`,replace:!0,miss:!0}}let l=Vd(r,n,{exclude:new Set([...o,i.klass])});if(l.length){let u=l.slice(0,Wd),d=l.slice(u.length);return{text:`${c} ${a}, and nothing I know about ${i.klass} says whether one can ${t}. I do know ${l.length} thing${l.length===1?"":"s"} that can ${t}${d.length?` (first ${u.length} shown)`:""}:
188
188
  ${u.map(oe).join(`
189
- `)}`,replace:!0,miss:!0,...d.length?{pending:{items:d.map(oe),noun:"facts"}}:{}}}return{text:`${c} ${a}, but nothing I remember says whether any kind of ${i.klass} can ${t}.`,replace:!0,miss:!0}}function kM(e){let t=String(e||"").toLowerCase().trim().replace(/\s+/g," ");if(t==="best")return"better";if(t==="worst")return"worse";let n=t.match(/^(most|least)\s+([a-z][\w-]*)$/);return n?`${n[1]==="most"?"more":"less"} ${n[2]}`:/[a-z]est$/.test(t)&&t.length>4?`${t.slice(0,-3)}er`:null}function yn(e){let t=new Set,n=[];for(let s of e){let o=`${s.subject}|${s.predicate}|${s.object}`;t.has(o)||(t.add(o),n.push(s))}return n}async function RS(e,t,n,s,o={},r=null,i=null){return _S(await FM(e,t,n,s,o,r,i),n,t)}function _S(e,t,n){if(!e||e.goal!==void 0)return e;let s=String(n||"").trim(),o=Em(t?.parsed);if(!o&&e.generalVerbQuery&&(o=FE),!o){let r=s.match(Sm),i=r?null:Kl(s).match(xS)||ES(s),a=r?r[2]:i?i[1]:null;a&&!km.has(a.toLowerCase())&&(o=FE)}if(!o){let r=s.match(AS);r&&(o=Em({shape:"meta",object:r[1]}))}return o?{...e,goal:o}:e}async function $m(e,t,n,s,o=null,r=[]){let{ON_PROPERTY_PREDICATE:i,SOME_VALUES_FROM_PREDICATE:a}=await Promise.resolve().then(()=>(It(),an)),c=await nt(e,t),l=new Map,u=new Map;for(let f of c)f.predicate===i?l.set(f.subject,f.object):f.predicate===a&&u.set(f.subject,f.object);let d=c.filter(f=>f.predicate===Xo&&n.has(f.subject)&&l.has(f.object)&&u.has(f.object)),p=d.filter(f=>s.has(u.get(f.object))).sort((f,m)=>f.object.localeCompare(m.object))[0];if(p){let f=new Map(c.map(g=>[g.id,g])),m=(p.justification||[]).map(g=>f.get(g)).filter(g=>g&&g.predicate===Xo),h=m.length?m:[p];return{text:`yes \u2014 ${[...r,...h].map(oe).join("; ")}`,replace:!0}}return d.length&&o?{text:`I can't confirm that \u2014 nothing I remember composes to it yet. Run "/classify ${o}", then ask me again.`,replace:!0,miss:!0}:null}async function OM(e,t,n){let{extractTableauModule:s,buildTableauKb:o,findTableauViolations:r}=await Promise.resolve().then(()=>(im(),rm)),{elUnsatisfiableClasses:i}=await Promise.resolve().then(()=>(LE(),NE)),a=e.filter(h=>h.predicate==="rdf:type"&&t.has(h.subject)).map(h=>h.object),c=[...new Set([...t,...a])],l=s(e,c),u=new Map(l.map(h=>[h.id,h])),d=o(l),p=d.individuals.filter(h=>t.has(h));if(p.length){let h={maxSteps:n.proveSteps,maxBranches:n.proveBranches,maxNodes:n.proveNodes},g=r(d,p,h)[0];if(g){let b=g.premises.map(y=>u.get(y)).filter(Boolean).map(oe).join("; ");return`I can't answer that \u2014 what I've been told about ${g.subject} is inconsistent: ${b||"the facts I hold about it clash"}. I'd need one of those retracted before I can answer honestly.`}}let f=i(l,{budget:n.classifyBudget,rounds:n.classifyRounds,focus:new Set(c)}),m=f.unsatisfiable.find(h=>t.has(h)||a.includes(h));if(m){let h=f.premisesOf(m).map(g=>u.get(g)).filter(Boolean).map(oe).join("; ");return`I can't answer that \u2014 "${m}" can never have any members: ${h||"its own subclass chain is unsatisfiable"}. I'd need one of those retracted before I can answer honestly.`}return null}function LM(e){return e.some(t=>{let n=String(t?.predicate||"").trim().toLowerCase();return NM.has(n)?!0:n==="rdf:type"&&String(t?.object||"").toLowerCase()==="transitiveproperty"})}function PM(e,t){return t>e.length?`one of ${t} possibilities`:e.map(n=>n.t==="nom"?n.ind:n.name).map(n=>`${Jo(n)} ${n}`).join(" or ")}function nS(e,t,n,{negate:s=!1}={}){let o=s?`is not a ${n}`:`is a ${n}`;return!e.cases||!e.cases.length?`so ${t} ${o}.`:`in every case \u2014 ${PM(e.cases,e.casesTotal)} \u2014 ${t} ${o}.`}async function MM(e,t,n,s,o,r,i){if(!LM(n))return null;let{extractTableauModule:a,buildTableauKb:c,proveEntailment:l,proveSubsumption:u,proveSubsumptionOfNegation:d,findTableauViolations:p,moduleHasDlShape:f}=await Promise.resolve().then(()=>(im(),rm)),{normFactTerm:m}=await Promise.resolve().then(()=>(qe(),Ms)),h=cS(o,n,m(s)),g=cS(r,n,m(i)),b=n.filter(I=>I.predicate==="rdf:type"&&o.has(I.subject)).map(I=>I.object),y=a(n,[h,g,...b]);if(!f(y))return null;let $=await CS(e);if(!$.askProveFallback)return null;let E=c(y),_={maxSteps:$.askProveSteps,maxBranches:$.askProveBranches,maxNodes:$.askProveNodes},v=E.namedIndividuals.has(h),S=new Map(y.map(I=>[I.id,I]));if(v){let I=p(E,[h],_)[0];if(I){let j=I.premises.map(k=>S.get(k)).filter(Boolean).map(oe).join("; ");return{text:`I can't answer that \u2014 what I've been told about ${I.subject} is inconsistent: ${j||"the facts I hold about it clash"}. I'd need one of those retracted before I can answer honestly.`,replace:!0}}}let C=I=>I.premises.map(j=>S.get(j)).filter(Boolean).map(oe).join("; "),x=v?l(E,h,{t:"atom",name:g},_):u(E,h,g,_);if(x.status==="proved"){let I=C(x),j=nS(x,s,i);return{text:`yes \u2014 ${I}; ${j}`,replace:!0}}if(x.status==="exhausted")return{budgetExhausted:!0};let R=v?l(E,h,{t:"not",c:{t:"atom",name:g}},_):d(E,h,g,_);if(R.status==="exhausted")return{budgetExhausted:!0};if(R.status!=="proved")return null;let w=C(R),T=nS(R,s,i,{negate:!0});return{text:`no \u2014 ${w}; ${T}`,replace:!0}}async function FM(e,t,n,s,o={},r=null,i=null){let a,c;try{({normFactTerm:a,normFactPredicate:c}=await Promise.resolve().then(()=>(qe(),Ms)))}catch{return null}let l=String(t).trim(),u=l.match(pM);if(u){let W=ee(a,u[1]),O=(await nt(e,r)).filter(D=>D.predicate==="mgx:usedFor"&&W.has(D.object));if(O.length){let N=at(yn(O),o).map(oe),F=N.slice(0,Re),z=N.slice(Re),B=z.length?`
189
+ `)}`,replace:!0,miss:!0,...d.length?{pending:{items:d.map(oe),noun:"facts"}}:{}}}return{text:`${c} ${a}, but nothing I remember says whether any kind of ${i.klass} can ${t}.`,replace:!0,miss:!0}}function MM(e){let t=String(e||"").toLowerCase().trim().replace(/\s+/g," ");if(t==="best")return"better";if(t==="worst")return"worse";let n=t.match(/^(most|least)\s+([a-z][\w-]*)$/);return n?`${n[1]==="most"?"more":"less"} ${n[2]}`:/[a-z]est$/.test(t)&&t.length>4?`${t.slice(0,-3)}er`:null}function vn(e){let t=new Set,n=[];for(let s of e){let o=`${s.subject}|${s.predicate}|${s.object}`;t.has(o)||(t.add(o),n.push(s))}return n}async function CS(e,t,n,s,o={},r=null,i=null){return IS(await YM(e,t,n,s,o,r,i),n,t)}function IS(e,t,n){if(!e||e.goal!==void 0)return e;let s=String(n||"").trim(),o=km(t?.parsed);if(!o&&e.generalVerbQuery&&(o=BE),!o){let r=s.match(Rm),i=r?null:Xl(s).match(kS)||RS(s),a=r?r[2]:i?i[1]:null;a&&!Tm.has(a.toLowerCase())&&(o=BE)}if(!o){let r=s.match(NS);r&&(o=km({shape:"meta",object:r[1]}))}return o?{...e,goal:o}:e}async function Em(e,t,n,s,o=null,r=[]){let{ON_PROPERTY_PREDICATE:i,SOME_VALUES_FROM_PREDICATE:a}=await Promise.resolve().then(()=>(Ot(),an)),c=await nt(e,t),l=new Map,u=new Map;for(let f of c)f.predicate===i?l.set(f.subject,f.object):f.predicate===a&&u.set(f.subject,f.object);let d=c.filter(f=>f.predicate===Jo&&n.has(f.subject)&&l.has(f.object)&&u.has(f.object)),p=d.filter(f=>s.has(u.get(f.object))).sort((f,m)=>f.object.localeCompare(m.object))[0];if(p){let f=new Map(c.map(g=>[g.id,g])),m=(p.justification||[]).map(g=>f.get(g)).filter(g=>g&&g.predicate===Jo),h=m.length?m:[p];return{text:`yes \u2014 ${[...r,...h].map(oe).join("; ")}`,replace:!0}}return d.length&&o?{text:`I can't confirm that \u2014 nothing I remember composes to it yet. Run "/classify ${o}", then ask me again.`,replace:!0,miss:!0}:null}async function GM(e,t,n){let{extractTableauModule:s,buildTableauKb:o,findTableauViolations:r}=await Promise.resolve().then(()=>(lm(),cm)),{elUnsatisfiableClasses:i}=await Promise.resolve().then(()=>(DE(),FE)),a=e.filter(h=>h.predicate==="rdf:type"&&t.has(h.subject)).map(h=>h.object),c=[...new Set([...t,...a])],l=s(e,c),u=new Map(l.map(h=>[h.id,h])),d=o(l),p=d.individuals.filter(h=>t.has(h));if(p.length){let h={maxSteps:n.proveSteps,maxBranches:n.proveBranches,maxNodes:n.proveNodes},g=r(d,p,h)[0];if(g){let b=g.premises.map(y=>u.get(y)).filter(Boolean).map(oe).join("; ");return`I can't answer that \u2014 what I've been told about ${g.subject} is inconsistent: ${b||"the facts I hold about it clash"}. I'd need one of those retracted before I can answer honestly.`}}let f=i(l,{budget:n.classifyBudget,rounds:n.classifyRounds,focus:new Set(c)}),m=f.unsatisfiable.find(h=>t.has(h)||a.includes(h));if(m){let h=f.premisesOf(m).map(g=>u.get(g)).filter(Boolean).map(oe).join("; ");return`I can't answer that \u2014 "${m}" can never have any members: ${h||"its own subclass chain is unsatisfiable"}. I'd need one of those retracted before I can answer honestly.`}return null}function HM(e){return e.some(t=>{let n=String(t?.predicate||"").trim().toLowerCase();return VM.has(n)?!0:n==="rdf:type"&&String(t?.object||"").toLowerCase()==="transitiveproperty"})}function qM(e,t){return t>e.length?`one of ${t} possibilities`:e.map(n=>n.t==="nom"?n.ind:n.name).map(n=>`${Qo(n)} ${n}`).join(" or ")}function iS(e,t,n,{negate:s=!1}={}){let o=s?`is not a ${n}`:`is a ${n}`;return!e.cases||!e.cases.length?`so ${t} ${o}.`:`in every case \u2014 ${qM(e.cases,e.casesTotal)} \u2014 ${t} ${o}.`}async function KM(e,t,n,s,o,r,i){if(!HM(n))return null;let{extractTableauModule:a,buildTableauKb:c,proveEntailment:l,proveSubsumption:u,proveSubsumptionOfNegation:d,findTableauViolations:p,moduleHasDlShape:f}=await Promise.resolve().then(()=>(lm(),cm)),{normFactTerm:m}=await Promise.resolve().then(()=>(qe(),Ms)),h=fS(o,n,m(s)),g=fS(r,n,m(i)),b=n.filter(I=>I.predicate==="rdf:type"&&o.has(I.subject)).map(I=>I.object),y=a(n,[h,g,...b]);if(!f(y))return null;let $=await LS(e);if(!$.askProveFallback)return null;let E=c(y),_={maxSteps:$.askProveSteps,maxBranches:$.askProveBranches,maxNodes:$.askProveNodes},v=E.namedIndividuals.has(h),S=new Map(y.map(I=>[I.id,I]));if(v){let I=p(E,[h],_)[0];if(I){let j=I.premises.map(k=>S.get(k)).filter(Boolean).map(oe).join("; ");return{text:`I can't answer that \u2014 what I've been told about ${I.subject} is inconsistent: ${j||"the facts I hold about it clash"}. I'd need one of those retracted before I can answer honestly.`,replace:!0}}}let C=I=>I.premises.map(j=>S.get(j)).filter(Boolean).map(oe).join("; "),x=v?l(E,h,{t:"atom",name:g},_):u(E,h,g,_);if(x.status==="proved"){let I=C(x),j=iS(x,s,i);return{text:`yes \u2014 ${I}; ${j}`,replace:!0}}if(x.status==="exhausted")return{budgetExhausted:!0};let R=v?l(E,h,{t:"not",c:{t:"atom",name:g}},_):d(E,h,g,_);if(R.status==="exhausted")return{budgetExhausted:!0};if(R.status!=="proved")return null;let w=C(R),T=iS(R,s,i,{negate:!0});return{text:`no \u2014 ${w}; ${T}`,replace:!0}}async function YM(e,t,n,s,o={},r=null,i=null){let a,c;try{({normFactTerm:a,normFactPredicate:c}=await Promise.resolve().then(()=>(qe(),Ms)))}catch{return null}let l=String(t).trim(),u=l.match(SM);if(u){let W=ee(a,u[1]),O=(await nt(e,r)).filter(D=>D.predicate==="mgx:usedFor"&&W.has(D.object));if(O.length){let N=at(vn(O),o).map(oe),F=N.slice(0,Re),z=N.slice(Re),B=z.length?`
190
190
  \u2026and ${z.length} more \u2014 say 'more' to see them.`:"";return{text:F.join(`
191
- `)+B,replace:!0,...z.length?{pending:{items:z,noun:"facts"}}:{}}}}for(let{predicate:W,re:O}of _M){let D=l.match(O);if(!D)continue;let N=ee(a,D[1]),F=(await nt(e,r)).filter(de=>de.predicate===W&&N.has(de.object));if(!F.length)continue;let B=at(yn(F),o).map(oe),G=B.slice(0,Re),J=B.slice(Re),ie=J.length?`
191
+ `)+B,replace:!0,...z.length?{pending:{items:z,noun:"facts"}}:{}}}}for(let{predicate:W,re:O}of DM){let D=l.match(O);if(!D)continue;let N=ee(a,D[1]),F=(await nt(e,r)).filter(de=>de.predicate===W&&N.has(de.object));if(!F.length)continue;let B=at(vn(F),o).map(oe),G=B.slice(0,Re),J=B.slice(Re),ie=J.length?`
192
192
  \u2026and ${J.length} more \u2014 say 'more' to see them.`:"";return{text:G.join(`
193
- `)+ie,replace:!0,...J.length?{pending:{items:J,noun:"facts"}}:{}}}let d=l.match(SM),p=d?null:l.match(jM),f=d?d[1]:p?.[2],m=d?d[2]:p?.[1],h=f&&m?kM(m):null;if(h){let W=`mgx:${h.replace(/\s+/g,"-")}-than`,O=await nt(e,r),D=ee(a,f),N=[...D].sort((B,G)=>B.length-G.length)[0],F=B=>D.has(B)||B.startsWith(`${N}-`)||B.startsWith(`${N} `)||O.some(G=>On.has(G.predicate)&&G.subject===B&&D.has(G.object)),z=yn(O.filter(B=>B.predicate===W&&Yo(B))).filter(B=>B.subject!==B.object&&F(B.subject)&&F(B.object));if(z.length){let B=new Set,G=new Map;for(let Z of z)B.add(Z.subject),B.add(Z.object),G.set(Z.object,(G.get(Z.object)||0)+1),G.has(Z.subject)||G.set(Z.subject,G.get(Z.subject)||0);let J=new Map(G),ie=[],de=null;for(;J.size;){let Z=[...J.keys()].filter(te=>J.get(te)===0);if(Z.length!==1){de=Z.length===0?{text:`I can't order the ${N}s \u2014 the "${h} than" facts I have loop back on themselves, so no ${m} exists. /memory to inspect them.`,replace:!0,miss:!0}:{text:`I can't pick the ${m} ${N} from what I know \u2014 nothing compares ${Z[0]} and ${Z[1]}. Teach me, e.g. "${Z[0]} is ${h} than ${Z[1]}".`,replace:!0,miss:!0};break}let Y=Z[0];ie.push(Y),J.delete(Y);for(let te of z)te.subject===Y&&J.has(te.object)&&J.set(te.object,J.get(te.object)-1)}if(de)return de;let ae=ie.slice(0,-1).map((Z,Y)=>z.find(te=>te.subject===Z&&te.object===ie[Y+1]));if(ae.every(Boolean)){let Z=ae.map(Y=>`${Zt(Y)}${Y.provenance?` (source: ${ms(Y.provenance)})`:""}`).join("; ");return{text:`${ie[0]} \u2014 ${Z}; so ${ie[0]} is the ${m} ${N}`,replace:!0}}}}let g=s?l.match(mM)||l.match(hM):null;if(g){let W=ee(a,g[1]),O=(await nt(e,r)).filter(D=>tr(D.predicate)!==null&&W.has(D.subject));if(O.length){let N=at(yn(O),o).map(oe),F=N.slice(0,Re),z=N.slice(Re),B=z.length?`
193
+ `)+ie,replace:!0,...J.length?{pending:{items:J,noun:"facts"}}:{}}}let d=l.match(LM),p=d?null:l.match(PM),f=d?d[1]:p?.[2],m=d?d[2]:p?.[1],h=f&&m?MM(m):null;if(h){let W=`mgx:${h.replace(/\s+/g,"-")}-than`,O=await nt(e,r),D=ee(a,f),N=[...D].sort((B,G)=>B.length-G.length)[0],F=B=>D.has(B)||B.startsWith(`${N}-`)||B.startsWith(`${N} `)||O.some(G=>Ln.has(G.predicate)&&G.subject===B&&D.has(G.object)),z=vn(O.filter(B=>B.predicate===W&&Xo(B))).filter(B=>B.subject!==B.object&&F(B.subject)&&F(B.object));if(z.length){let B=new Set,G=new Map;for(let Z of z)B.add(Z.subject),B.add(Z.object),G.set(Z.object,(G.get(Z.object)||0)+1),G.has(Z.subject)||G.set(Z.subject,G.get(Z.subject)||0);let J=new Map(G),ie=[],de=null;for(;J.size;){let Z=[...J.keys()].filter(te=>J.get(te)===0);if(Z.length!==1){de=Z.length===0?{text:`I can't order the ${N}s \u2014 the "${h} than" facts I have loop back on themselves, so no ${m} exists. /memory to inspect them.`,replace:!0,miss:!0}:{text:`I can't pick the ${m} ${N} from what I know \u2014 nothing compares ${Z[0]} and ${Z[1]}. Teach me, e.g. "${Z[0]} is ${h} than ${Z[1]}".`,replace:!0,miss:!0};break}let Y=Z[0];ie.push(Y),J.delete(Y);for(let te of z)te.subject===Y&&J.has(te.object)&&J.set(te.object,J.get(te.object)-1)}if(de)return de;let ae=ie.slice(0,-1).map((Z,Y)=>z.find(te=>te.subject===Z&&te.object===ie[Y+1]));if(ae.every(Boolean)){let Z=ae.map(Y=>`${en(Y)}${Y.provenance?` (source: ${ms(Y.provenance)})`:""}`).join("; ");return{text:`${ie[0]} \u2014 ${Z}; so ${ie[0]} is the ${m} ${N}`,replace:!0}}}}let g=s?l.match(jM)||l.match(kM):null;if(g){let W=ee(a,g[1]),O=(await nt(e,r)).filter(D=>nr(D.predicate)!==null&&W.has(D.subject));if(O.length){let N=at(vn(O),o).map(oe),F=N.slice(0,Re),z=N.slice(Re),B=z.length?`
194
194
  \u2026and ${z.length} more \u2014 say 'more' to see them.`:"";return{text:F.join(`
195
- `)+B,replace:!0,...z.length?{pending:{items:z,noun:"facts"}}:{}}}}let b=l.match(gM);if(b){let W=b[1].toLowerCase(),O=ee(a,b[2].replace(/^(?:an?|the)\s+/i,"").trim()),D=(await nt(e,r)).filter(N=>tr(N.predicate)===W&&O.has(N.object));if(D.length){let F=at(yn(D),o).map(oe),z=F.slice(0,Re),B=F.slice(Re),G=B.length?`
195
+ `)+B,replace:!0,...z.length?{pending:{items:z,noun:"facts"}}:{}}}}let b=l.match(RM);if(b){let W=b[1].toLowerCase(),O=ee(a,b[2].replace(/^(?:an?|the)\s+/i,"").trim()),D=(await nt(e,r)).filter(N=>nr(N.predicate)===W&&O.has(N.object));if(D.length){let F=at(vn(D),o).map(oe),z=F.slice(0,Re),B=F.slice(Re),G=B.length?`
196
196
  \u2026and ${B.length} more \u2014 say 'more' to see them.`:"";return{text:z.join(`
197
- `)+G,replace:!0,...B.length?{pending:{items:B,noun:"facts"}}:{}}}}{let W=l.match(bM),O=W?W[2]:b&&["in","inside"].includes(b[1].toLowerCase())?b[2]:null;if(O!=null){let D=W&&W[1].toLowerCase()==="parts"?["mgx:partOf"]:MP,N=ee(a,O.replace(/^(?:an?|the)\s+/i,"").trim()),F=(await nt(e,r)).filter(z=>D.includes(z.predicate)&&N.has(z.object)).sort(yP);if(F.length){let B=at(yn(F),o).map(oe),G=B.slice(0,Re),J=B.slice(Re),ie=J.length?`
197
+ `)+G,replace:!0,...B.length?{pending:{items:B,noun:"facts"}}:{}}}}{let W=l.match(_M),O=W?W[2]:b&&["in","inside"].includes(b[1].toLowerCase())?b[2]:null;if(O!=null){let D=W&&W[1].toLowerCase()==="parts"?["mgx:partOf"]:KP,N=ee(a,O.replace(/^(?:an?|the)\s+/i,"").trim()),F=(await nt(e,r)).filter(z=>D.includes(z.predicate)&&N.has(z.object)).sort(AP);if(F.length){let B=at(vn(F),o).map(oe),G=B.slice(0,Re),J=B.slice(Re),ie=J.length?`
198
198
  \u2026and ${J.length} more \u2014 say 'more' to see them.`:"";return{text:G.join(`
199
- `)+ie,replace:!0,...J.length?{pending:{items:J,noun:"facts"}}:{}}}}}let y=l.match(wM);if(y){let W=y[3].toLowerCase(),O=ee(a,y[2]),D=new Set([...ee(a,y[1])].map(F=>c(`mgx:${W}-${F.replace(/\s+/g,"-")}`))),N=(await nt(e,r)).filter(F=>D.has(c(F.predicate))&&O.has(a(F.subject)));if(N.length){let z=at(yn(N),o).map(oe),B=z.slice(0,Re),G=z.slice(Re),J=G.length?`
199
+ `)+ie,replace:!0,...J.length?{pending:{items:J,noun:"facts"}}:{}}}}}let y=l.match(TM);if(y){let W=y[3].toLowerCase(),O=ee(a,y[2]),D=new Set([...ee(a,y[1])].map(F=>c(`mgx:${W}-${F.replace(/\s+/g,"-")}`))),N=(await nt(e,r)).filter(F=>D.has(c(F.predicate))&&O.has(a(F.subject)));if(N.length){let z=at(vn(N),o).map(oe),B=z.slice(0,Re),G=z.slice(Re),J=G.length?`
200
200
  \u2026and ${G.length} more \u2014 say 'more' to see them.`:"";return{text:B.join(`
201
- `)+J,replace:!0,...G.length?{pending:{items:G,noun:"facts"}}:{}}}}let $=n?.parsed?.shape==="meta"?n.parsed.object:null,E=n?.parsed&&n.parsed.node!=="miss";if(!$&&s&&!E&&!tS.test(l)){let W=l.match(AS)||l.match(/^what\s+(?:does|do)\s+(.+?)\s+means?[?.!\s]*$/i);W&&($=Gs(W[1]))}if(!$&&s){let W=l.match(tF);W&&($=Gs(pn(W[1].trim())))}if(!$&&n?.ambiguous&&Array.isArray(n.candidateParses)){let W=n.candidateParses.find(O=>O?.shape==="meta"&&O.object);W&&($=Gs(String(W.object)))}if($){let W=UP($),{predicate:O}=W,D=W.subject.replace(/^(?:the|an?)\s+/i,"").trim()||W.subject,N=!1;if(O&&Ds.test(D)){if(!i){let re=String(Fs[O]||"").replace(/^(?:is|are)\s+/,"");return{text:`not sure what "${D.toLowerCase()}" refers to yet \u2014 name the subject directly, e.g. "what is a <name>${re?` ${re}`:""}".`,replace:s,miss:!0,selfContainedMiss:!0}}D=i,N=!0}let F=ee(a,D),z=await nt(e,r);if(!z.some(re=>F.has(re.subject)||F.has(re.object))){let re=sM(D,z,a);re&&(D=re,F=ee(a,D))}let B=(await nt(e,r)).filter(re=>F.has(re.subject)&&!BE.has(re.predicate)&&!WE(re)&&!GE.has(re.predicate)),G=O?B.filter(re=>c(re.predicate)===O):B;if(!O&&G.length&&!G.some(vm)&&(G=[]),!G.length){if(O&&(B.length||N))return{text:`I don't have any "${Fs[O]}" facts about ${D}.`,replace:s,...B.length?{}:{miss:!0}};if(!O){let re=at((await nt(e,r)).filter(Te=>F.has(Te.object)),o);if(re.length&&!re.some(vm)&&(re=[]),re.length){let Te=re.map(oe),fe=Te.slice(0,Re),Se=Te.slice(Re),Le=Se.length?`
201
+ `)+J,replace:!0,...G.length?{pending:{items:G,noun:"facts"}}:{}}}}let $=n?.parsed?.shape==="meta"?n.parsed.object:null,E=n?.parsed&&n.parsed.node!=="miss";if(!$&&s&&!E&&!rS.test(l)){let W=l.match(NS)||l.match(/^what\s+(?:does|do)\s+(.+?)\s+means?[?.!\s]*$/i);W&&($=Gs(W[1]))}if(!$&&s){let W=l.match(fF);W&&($=Gs(pn(W[1].trim())))}if(!$&&n?.ambiguous&&Array.isArray(n.candidateParses)){let W=n.candidateParses.find(O=>O?.shape==="meta"&&O.object);W&&($=Gs(String(W.object)))}if($){let W=QP($),{predicate:O}=W,D=W.subject.replace(/^(?:the|an?)\s+/i,"").trim()||W.subject,N=!1;if(O&&Ds.test(D)){if(!i){let re=String(Fs[O]||"").replace(/^(?:is|are)\s+/,"");return{text:`not sure what "${D.toLowerCase()}" refers to yet \u2014 name the subject directly, e.g. "what is a <name>${re?` ${re}`:""}".`,replace:s,miss:!0,selfContainedMiss:!0}}D=i,N=!0}let F=ee(a,D),z=await nt(e,r);if(!z.some(re=>F.has(re.subject)||F.has(re.object))){let re=mM(D,z,a);re&&(D=re,F=ee(a,D))}let B=(await nt(e,r)).filter(re=>F.has(re.subject)&&!HE.has(re.predicate)&&!qE(re)&&!KE.has(re.predicate)),G=O?B.filter(re=>c(re.predicate)===O):B;if(!O&&G.length&&!G.some(Sm)&&(G=[]),!G.length){if(O&&(B.length||N))return{text:`I don't have any "${Fs[O]}" facts about ${D}.`,replace:s,...B.length?{}:{miss:!0}};if(!O){let re=at((await nt(e,r)).filter(Ae=>F.has(Ae.object)),o);if(re.length&&!re.some(Sm)&&(re=[]),re.length){let Ae=re.map(oe),fe=Ae.slice(0,Re),Se=Ae.slice(Re),Le=Se.length?`
202
202
  \u2026and ${Se.length} more \u2014 say 'more' to see them.`:"";return{text:fe.join(`
203
- `)+Le,replace:s,...Se.length?{pending:{items:Se,noun:"facts"}}:{}}}}return null}G=at(G,o);let J=await nt(e,r),{lines:ie,grouped:de}=qE(G,J,F),ae=!O&&ie.length>WP?await GP(D,G,J,ie):null;if(ae)return{...ae,replace:s};if(de)return{...de,replace:s};let Z=ie.slice(0,Re),Y=ie.slice(Re),te=Y.length?`
203
+ `)+Le,replace:s,...Se.length?{pending:{items:Se,noun:"facts"}}:{}}}}return null}G=at(G,o);let J=await nt(e,r),{lines:ie,grouped:de}=JE(G,J,F),ae=!O&&ie.length>eM?await tM(D,G,J,ie):null;if(ae)return{...ae,replace:s};if(de)return{...de,replace:s};let Z=ie.slice(0,Re),Y=ie.slice(Re),te=Y.length?`
204
204
  \u2026and ${Y.length} more \u2014 say 'more' to see them.`:"";return{text:Z.join(`
205
- `)+te,replace:s,...Y.length?{pending:{items:Y,noun:"facts"}}:{}}}if(!s)return null;let _=l.match(vP);if(_){let O=`mgx:${_[2].toLowerCase().replace(/\s+/g,"-")}-than`,D=await Ul(e),N=ae=>{let Z=ae.replace(/^(?:an?|the)\s+/i,"").trim();return i&&Ds.test(Z)?i:Z},F=N(_[1]),z=N(_[3]),B=ee(a,F),G=ee(a,z),J=D.find(ae=>ae.predicate===O&&B.has(ae.subject)&&G.has(ae.object));if(J){let ae=D.find(Y=>Y.predicate===O&&B.has(Y.object)&&G.has(Y.subject)),Z=ae?` \u2014 though you also told me the opposite: ${oe(ae)}. Both are stored; I won't silently pick one.`:"";return{text:`yes \u2014 ${oe(J)}${Z}`,replace:!0}}let ie=D.filter(ae=>ae.predicate===O&&(B.has(ae.subject)||B.has(ae.object)));return{text:`I can't confirm that \u2014 nothing I remember compares them that way.${ie.length?` I do know: ${ie.slice(0,3).map(oe).join("; ")}.`:""} If it's true, teach me: "${F} is ${_[2].toLowerCase()} than ${z}".`,replace:!0,miss:!0}}let v=Hl(l).match(aM);if(v){let W=ee(a,v[1]),O=v[2].toLowerCase(),D=await nt(e,r),N=jS(D,W,O,a)??cM(D,W,new Set([`be ${O}`,O]),a);if(N)return{text:`yes \u2014 ${N.map(oe).join("; ")}`,replace:!0}}for(let{predicate:W,phrase:O,re:D}of CM){let N=l.match(D);if(!N)continue;let F=await Ul(e),z=ee(a,N[1]),B=ee(a,N[2]),G=F.find(Z=>Z.predicate===W&&z.has(Z.subject)&&B.has(Z.object));if(G)return{text:`yes \u2014 ${oe(G)}`,replace:!0};let[J]=O.split(" "),ie=await Vl(Xl(J));if(ie!==W){let Z=ie.replace(/^mgx:/,"mgxneg:");if(F.some(Y=>(Y.predicate===ie||Y.predicate===Z)&&z.has(Y.subject)))continue}let de=AM.has(W)?` If it's true, teach me: "${N[1]} ${O} ${N[2]}".`:"",ae=F.filter(Z=>Z.predicate===W&&z.has(Z.subject));if(ae.length){let Z=ae.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${N[1]} ${O} ${N[2]}. I do know: ${Z}.${de}`,replace:!0,miss:!0}}if(!n?.parsed&&F.some(Z=>z.has(Z.subject)))return{text:`I can't confirm that \u2014 nothing I remember says ${N[1]} ${O} ${N[2]}.${de}`,replace:!0,miss:!0};break}let S=l.match(po)||jm(l);if(S){let W=ee(a,S[1]),O=ee(a,S[2]),D=await nt(e,r),N=G=>W.has(G.subject)&&O.has(G.object),{DISJOINT_PREDICATE:F}=await Promise.resolve().then(()=>(It(),an)),z=G=>W.has(G.subject)||W.has(G.object)||O.has(G.subject)||O.has(G.object);return D.some(G=>G.predicate===F&&Yo(G)&&z(G))?null:$S(D.find(G=>On.has(G.predicate)&&N(G)),D.find(G=>G.predicate===rc&&N(G)))}let C=Hl(l),x=C.match(oM);if(x){let W=await nt(e,r),O=x[1],D=ZE(x[2],x[3],W);if(D&&C!==QE(l)&&(D=JE(D)),D&&O)return{text:`I can't speak for ${O.trim()} ${x[2]} \u2014 what I remember is generic, not universal. ${D.text}.`,replace:!0};if(D)return D;let N=ee(a,x[2]),F=W.filter(z=>z.predicate==="mgx:capableOf"&&N.has(z.subject));if(F.length){let z=F.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${x[2]} can ${x[3]}. I do know: ${z}. If it's true, teach me: "a ${F[0].subject} can ${x[3]}".`,replace:!0,miss:!0}}return eS(x[2],x[3],W)}let R=l.match(iM);if(R){let W=ee(a,R[1]),O=ee(a,R[2]),N=(await Ul(e)).map(F=>({fact:F,quantified:XE.has(F.predicate)&&O.has(F.subject)?lM(F.object):null})).find(({quantified:F})=>F&&[...ee(a,F.part)].some(z=>W.has(z)));if(N)return{text:`${N.quantified.count} \u2014 ${oe(N.fact)}`,replace:!0}}let w=l.match(rM);if(w){let W=ee(a,w[1]),O=ee(a,w[2]),D=await Ul(e),N=G=>D.find(J=>XE.has(J.predicate)&&G.has(J.subject)&&O.has(J.object)),F=N(W);if(F)return{text:`yes \u2014 ${oe(F)}`,replace:!0};let z=[{terms:W,chain:[]}],B=new Set;for(let G=0;G<4;G+=1){let J=[];for(let{terms:ie,chain:de}of z){let ae=D.filter(Z=>On.has(Z.predicate)&&ie.has(Z.subject)&&!B.has(Z.object));for(let Z of ae){if(B.has(Z.object))continue;B.add(Z.object);let Y=[...de,Z],te=ee(a,Z.object),re=N(te);if(re)return{text:`yes \u2014 ${[...Y.map(oe),oe(re)].join("; ")}`,replace:!0};let Te=await $m(e,r,te,O,null,Y);if(Te)return Te;J.push({terms:te,chain:Y})}}if(!J.length)break;z=J}return $m(e,r,W,O,w[1].trim())}let T=l.match(uM);if(T){let W=ee(a,T[1]),O=ee(a,T[3]),D=await $m(e,r,W,O,T[1].trim());if(D)return D}let I=Hl(l),j=I.match(yM);if(j){let W=await nt(e,r),O=!!j[1],D=ee(a,j[2]),N=ee(a,j[3]),F=ZE(j[2],j[3],W);if(F&&I!==QE(l)&&(F=JE(F)),F&&O)return{text:`I can't speak for ${j[1].trim()} ${j[2]} \u2014 what I remember is generic, not universal. ${F.text}.`,replace:!0};if(F)return F;if(s){let z=W.filter(G=>G.predicate==="mgx:capableOf"&&D.has(G.subject));if(z.length){let G=z.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${j[2]} can ${j[3]}. I do know: ${G}. If it's true, teach me: "a ${z[0].subject} can ${j[3]}".`,replace:!0,miss:!0}}let B=eS(j[2],j[3],W);if(B)return B;if(!/\s/.test(j[2].trim())&&!W.some(G=>D.has(G.subject)||D.has(G.object))){let G=Cm(ql(j[2]));return{text:`I can't confirm that \u2014 I don't know anything about "${j[2]}" yet. Teach me "a ${G} can ${j[3]}" (or "a ${G} cannot ${j[3]}") and I'll remember it.`,replace:!0,miss:!0}}}}let k=l.match(dM);if(k){let W=ee(a,k[1]),O=(await nt(e,r)).filter(G=>(G.predicate==="mgx:capableOf"||G.predicate===Sr)&&W.has(G.subject));if(!O.length)return null;let N=at(yn(O),o).map(oe),F=N.slice(0,Re),z=N.slice(Re),B=z.length?`
205
+ `)+te,replace:s,...Y.length?{pending:{items:Y,noun:"facts"}}:{}}}if(!s)return null;let _=l.match(IP);if(_){let O=`mgx:${_[2].toLowerCase().replace(/\s+/g,"-")}-than`,D=await Wl(e),N=ae=>{let Z=ae.replace(/^(?:an?|the)\s+/i,"").trim();return i&&Ds.test(Z)?i:Z},F=N(_[1]),z=N(_[3]),B=ee(a,F),G=ee(a,z),J=D.find(ae=>ae.predicate===O&&B.has(ae.subject)&&G.has(ae.object));if(J){let ae=D.find(Y=>Y.predicate===O&&B.has(Y.object)&&G.has(Y.subject)),Z=ae?` \u2014 though you also told me the opposite: ${oe(ae)}. Both are stored; I won't silently pick one.`:"";return{text:`yes \u2014 ${oe(J)}${Z}`,replace:!0}}let ie=D.filter(ae=>ae.predicate===O&&(B.has(ae.subject)||B.has(ae.object)));return{text:`I can't confirm that \u2014 nothing I remember compares them that way.${ie.length?` I do know: ${ie.slice(0,3).map(oe).join("; ")}.`:""} If it's true, teach me: "${F} is ${_[2].toLowerCase()} than ${z}".`,replace:!0,miss:!0}}let v=Kl(l).match(wM);if(v){let W=ee(a,v[1]),O=v[2].toLowerCase(),D=await nt(e,r),N=TS(D,W,O,a)??yM(D,W,new Set([`be ${O}`,O]),a);if(N)return{text:`yes \u2014 ${N.map(oe).join("; ")}`,replace:!0}}for(let{predicate:W,phrase:O,re:D}of BM){let N=l.match(D);if(!N)continue;let F=await Wl(e),z=ee(a,N[1]),B=ee(a,N[2]),G=F.find(Z=>Z.predicate===W&&z.has(Z.subject)&&B.has(Z.object));if(G)return{text:`yes \u2014 ${oe(G)}`,replace:!0};let[J]=O.split(" "),ie=await ql(Ql(J));if(ie!==W){let Z=ie.replace(/^mgx:/,"mgxneg:");if(F.some(Y=>(Y.predicate===ie||Y.predicate===Z)&&z.has(Y.subject)))continue}let de=UM.has(W)?` If it's true, teach me: "${N[1]} ${O} ${N[2]}".`:"",ae=F.filter(Z=>Z.predicate===W&&z.has(Z.subject));if(ae.length){let Z=ae.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${N[1]} ${O} ${N[2]}. I do know: ${Z}.${de}`,replace:!0,miss:!0}}if(!n?.parsed&&F.some(Z=>z.has(Z.subject)))return{text:`I can't confirm that \u2014 nothing I remember says ${N[1]} ${O} ${N[2]}.${de}`,replace:!0,miss:!0};break}let S=l.match(mo)||_m(l);if(S){let W=ee(a,S[1]),O=ee(a,S[2]),D=await nt(e,r),N=G=>W.has(G.subject)&&O.has(G.object),{DISJOINT_PREDICATE:F}=await Promise.resolve().then(()=>(Ot(),an)),z=G=>W.has(G.subject)||W.has(G.object)||O.has(G.subject)||O.has(G.object);return D.some(G=>G.predicate===F&&Xo(G)&&z(G))?null:SS(D.find(G=>Ln.has(G.predicate)&&N(G)),D.find(G=>G.predicate===ac&&N(G)))}let C=Kl(l),x=C.match(hM);if(x){let W=await nt(e,r),O=x[1],D=sS(x[2],x[3],W);if(D&&C!==nS(l)&&(D=tS(D)),D&&O)return{text:`I can't speak for ${O.trim()} ${x[2]} \u2014 what I remember is generic, not universal. ${D.text}.`,replace:!0};if(D)return D;let N=ee(a,x[2]),F=W.filter(z=>z.predicate==="mgx:capableOf"&&N.has(z.subject));if(F.length){let z=F.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${x[2]} can ${x[3]}. I do know: ${z}. If it's true, teach me: "a ${F[0].subject} can ${x[3]}".`,replace:!0,miss:!0}}return oS(x[2],x[3],W)}let R=l.match(bM);if(R){let W=ee(a,R[1]),O=ee(a,R[2]),N=(await Wl(e)).map(F=>({fact:F,quantified:eS.has(F.predicate)&&O.has(F.subject)?$M(F.object):null})).find(({quantified:F})=>F&&[...ee(a,F.part)].some(z=>W.has(z)));if(N)return{text:`${N.quantified.count} \u2014 ${oe(N.fact)}`,replace:!0}}let w=l.match(gM);if(w){let W=ee(a,w[1]),O=ee(a,w[2]),D=await Wl(e),N=G=>D.find(J=>eS.has(J.predicate)&&G.has(J.subject)&&O.has(J.object)),F=N(W);if(F)return{text:`yes \u2014 ${oe(F)}`,replace:!0};let z=[{terms:W,chain:[]}],B=new Set;for(let G=0;G<4;G+=1){let J=[];for(let{terms:ie,chain:de}of z){let ae=D.filter(Z=>Ln.has(Z.predicate)&&ie.has(Z.subject)&&!B.has(Z.object));for(let Z of ae){if(B.has(Z.object))continue;B.add(Z.object);let Y=[...de,Z],te=ee(a,Z.object),re=N(te);if(re)return{text:`yes \u2014 ${[...Y.map(oe),oe(re)].join("; ")}`,replace:!0};let Ae=await Em(e,r,te,O,null,Y);if(Ae)return Ae;J.push({terms:te,chain:Y})}}if(!J.length)break;z=J}return Em(e,r,W,O,w[1].trim())}let T=l.match(vM);if(T){let W=ee(a,T[1]),O=ee(a,T[3]),D=await Em(e,r,W,O,T[1].trim());if(D)return D}let I=Kl(l),j=I.match(AM);if(j){let W=await nt(e,r),O=!!j[1],D=ee(a,j[2]),N=ee(a,j[3]),F=sS(j[2],j[3],W);if(F&&I!==nS(l)&&(F=tS(F)),F&&O)return{text:`I can't speak for ${j[1].trim()} ${j[2]} \u2014 what I remember is generic, not universal. ${F.text}.`,replace:!0};if(F)return F;if(s){let z=W.filter(G=>G.predicate==="mgx:capableOf"&&D.has(G.subject));if(z.length){let G=z.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${j[2]} can ${j[3]}. I do know: ${G}. If it's true, teach me: "a ${z[0].subject} can ${j[3]}".`,replace:!0,miss:!0}}let B=oS(j[2],j[3],W);if(B)return B;if(!/\s/.test(j[2].trim())&&!W.some(G=>D.has(G.subject)||D.has(G.object))){let G=Nm(Yl(j[2]));return{text:`I can't confirm that \u2014 I don't know anything about "${j[2]}" yet. Teach me "a ${G} can ${j[3]}" (or "a ${G} cannot ${j[3]}") and I'll remember it.`,replace:!0,miss:!0}}}}let k=l.match(xM);if(k){let W=ee(a,k[1]),O=(await nt(e,r)).filter(G=>(G.predicate==="mgx:capableOf"||G.predicate===Sr)&&W.has(G.subject));if(!O.length)return null;let N=at(vn(O),o).map(oe),F=N.slice(0,Re),z=N.slice(Re),B=z.length?`
206
206
  \u2026and ${z.length} more \u2014 say 'more' to see them.`:"";return{text:F.join(`
207
- `)+B,replace:!0,...z.length?{pending:{items:z,noun:"facts"}}:{}}}let P=l.match(xM);if(P){let W=ee(a,P[1]),O=ee(a,P[2]),D=await nt(e,r),N=yn(D.filter(F=>F.predicate==="mgx:capableOf"&&O.has(F.object))).filter(F=>ac(new Set([F.subject]),O,D).verdict==="yes");if(N.length){let{findIsaChain:F,buildSubClassSuccessors:z,SUBCLASS_PREDICATE:B,TYPE_PREDICATE:G}=await Promise.resolve().then(()=>(It(),an)),J=D.filter(ce=>ce.predicate===B),ie=D.filter(ce=>ce.predicate===G),de=J.map(ce=>[ce.subject,ce.object]),ae=ie.map(ce=>[ce.subject,ce.object]),Z=z(de),Y=ce=>(ce.predicate===B?J:ie).find(le=>le.subject===ce.subject&&le.object===ce.object),te=new Map,re=N.filter(ce=>W.has(ce.subject)?!0:(te.has(ce.subject)||te.set(ce.subject,F(ce.subject,W,ae,Z,{maxHops:3})),!!te.get(ce.subject))),fe=at(re.length?re:N,o).map(ce=>{let le=re.length?te.get(ce.subject):null;if(!le||le.length<2)return oe(ce);let pe=le.map(Y);if(!pe.every(Boolean))return oe(ce);let Xe=pe.map(wt=>`${Zt(wt)}${wt.provenance?` (source: ${ms(wt.provenance)})`:""}`).join("; ");return`${oe(ce)} \u2014 via: ${Xe}`}),Se=fe.slice(0,Re),Le=fe.slice(Re),je=Le.length?`
207
+ `)+B,replace:!0,...z.length?{pending:{items:z,noun:"facts"}}:{}}}let P=l.match(OM);if(P){let W=ee(a,P[1]),O=ee(a,P[2]),D=await nt(e,r),N=vn(D.filter(F=>F.predicate==="mgx:capableOf"&&O.has(F.object))).filter(F=>lc(new Set([F.subject]),O,D).verdict==="yes");if(N.length){let{findIsaChain:F,buildSubClassSuccessors:z,SUBCLASS_PREDICATE:B,TYPE_PREDICATE:G}=await Promise.resolve().then(()=>(Ot(),an)),J=D.filter(ce=>ce.predicate===B),ie=D.filter(ce=>ce.predicate===G),de=J.map(ce=>[ce.subject,ce.object]),ae=ie.map(ce=>[ce.subject,ce.object]),Z=z(de),Y=ce=>(ce.predicate===B?J:ie).find(le=>le.subject===ce.subject&&le.object===ce.object),te=new Map,re=N.filter(ce=>W.has(ce.subject)?!0:(te.has(ce.subject)||te.set(ce.subject,F(ce.subject,W,ae,Z,{maxHops:3})),!!te.get(ce.subject))),fe=at(re.length?re:N,o).map(ce=>{let le=re.length?te.get(ce.subject):null;if(!le||le.length<2)return oe(ce);let pe=le.map(Y);if(!pe.every(Boolean))return oe(ce);let Xe=pe.map(wt=>`${en(wt)}${wt.provenance?` (source: ${ms(wt.provenance)})`:""}`).join("; ");return`${oe(ce)} \u2014 via: ${Xe}`}),Se=fe.slice(0,Re),Le=fe.slice(Re),je=Le.length?`
208
208
  \u2026and ${Le.length} more \u2014 say 'more' to see them.`:"";return{text:(re.length?"":`nothing I remember ties these to "${P[1]}", but:
209
209
  `)+Se.join(`
210
- `)+je,replace:!0,...Le.length?{pending:{items:Le,noun:"facts"}}:{}}}}let U=l.match(vM);if(U&&U[1].trim().split(/\s+/).at(-1)?.toLowerCase()!=="do"){let W=ee(a,U[1]),O=(await nt(e,r)).filter(D=>D.predicate==="mgxneg:capableOf"&&W.has(D.object));if(O.length){let N=at(yn(O),o).map(oe),F=N.slice(0,Re),z=N.slice(Re),B=z.length?`
210
+ `)+je,replace:!0,...Le.length?{pending:{items:Le,noun:"facts"}}:{}}}}let U=l.match(IM);if(U&&U[1].trim().split(/\s+/).at(-1)?.toLowerCase()!=="do"){let W=ee(a,U[1]),O=(await nt(e,r)).filter(D=>D.predicate==="mgxneg:capableOf"&&W.has(D.object));if(O.length){let N=at(vn(O),o).map(oe),F=N.slice(0,Re),z=N.slice(Re),B=z.length?`
211
211
  \u2026and ${z.length} more \u2014 say 'more' to see them.`:"";return{text:F.join(`
212
- `)+B,replace:!0,...z.length?{pending:{items:z,noun:"facts"}}:{}}}return{text:`nothing I remember says anything cannot ${U[1].trim()}.`,replace:!0,miss:!0}}let H=l.match($M);if(H&&H[1].trim().split(/\s+/).at(-1)?.toLowerCase()!=="do"){let W=ee(a,H[1]),O=Bd(W,await nt(e,r));if(O.length){let N=at(yn(O),o).map(oe),F=N.slice(0,Re),z=N.slice(Re),B=z.length?`
212
+ `)+B,replace:!0,...z.length?{pending:{items:z,noun:"facts"}}:{}}}return{text:`nothing I remember says anything cannot ${U[1].trim()}.`,replace:!0,miss:!0}}let H=l.match(CM);if(H&&H[1].trim().split(/\s+/).at(-1)?.toLowerCase()!=="do"){let W=ee(a,H[1]),O=Vd(W,await nt(e,r));if(O.length){let N=at(vn(O),o).map(oe),F=N.slice(0,Re),z=N.slice(Re),B=z.length?`
213
213
  \u2026and ${z.length} more \u2014 say 'more' to see them.`:"";return{text:F.join(`
214
- `)+B,replace:!0,...z.length?{pending:{items:z,noun:"facts"}}:{}}}}let X=l.match(fM);if(X&&!IM.has(X[1].trim().split(/\s+/)[0]?.toLowerCase())){let W=ee(a,X[1]),O=(await nt(e,r)).filter(G=>G.predicate==="mgx:hasA"&&W.has(G.object));if(!O.length)return null;let N=at(yn(O),o).map(oe),F=N.slice(0,Re),z=N.slice(Re),B=z.length?`
214
+ `)+B,replace:!0,...z.length?{pending:{items:z,noun:"facts"}}:{}}}}let X=l.match(EM);if(X&&!WM.has(X[1].trim().split(/\s+/)[0]?.toLowerCase())){let W=ee(a,X[1]),O=(await nt(e,r)).filter(G=>G.predicate==="mgx:hasA"&&W.has(G.object));if(!O.length)return null;let N=at(vn(O),o).map(oe),F=N.slice(0,Re),z=N.slice(Re),B=z.length?`
215
215
  \u2026and ${z.length} more \u2014 say 'more' to see them.`:"";return{text:F.join(`
216
- `)+B,replace:!0,...z.length?{pending:{items:z,noun:"facts"}}:{}}}let Q=l.match(tS),L=n?.parsed?.shape==="reverse"&&n.parsed.kind==="inherits"?n.parsed.object:Q?.[1];if(L){let W=ee(a,L),O=(await nt(e,r)).filter(G=>On.has(G.predicate)&&W.has(G.object));if(!O.length)return null;let N=at(yn(O),o).map(oe),F=N.slice(0,Re),z=N.slice(Re),B=z.length?`
216
+ `)+B,replace:!0,...z.length?{pending:{items:z,noun:"facts"}}:{}}}let Q=l.match(rS),L=n?.parsed?.shape==="reverse"&&n.parsed.kind==="inherits"?n.parsed.object:Q?.[1];if(L){let W=ee(a,L),O=(await nt(e,r)).filter(G=>Ln.has(G.predicate)&&W.has(G.object));if(!O.length)return null;let N=at(vn(O),o).map(oe),F=N.slice(0,Re),z=N.slice(Re),B=z.length?`
217
217
  \u2026and ${z.length} more \u2014 say 'more' to see them.`:"";return{text:F.join(`
218
- `)+B,replace:!0,...z.length?{pending:{items:z,noun:"facts"}}:{}}}let V=l.match(nM);if(V){let W=ee(a,V[1]),O=await nt(e,r),D=se=>!String(se.provenance||"").includes("corpus:")&&!String(se.provenance||"").includes("web:"),N=O.filter(se=>On.has(se.predicate)&&D(se)),F=new Set,z=W;for(let se=0;se<8&&z.size;se+=1){let Pe=new Set;for(let Ue of N)z.has(Ue.object)&&!F.has(Ue.subject)&&Pe.add(Ue.subject);if(!Pe.size)break;for(let Ue of Pe)F.add(Ue);let st=new Set;for(let Ue of Pe)for(let Us of ee(a,Ue))st.add(Us);z=st}let B=O.filter(se=>W.has(se.subject)||W.has(se.object)||F.has(se.subject));if(!B.length){let se=a(V[1]).split(/\s+/).filter(Pe=>Pe.length>=4&&!vS.has(Pe));if(se.length){let Pe=Ue=>new Set(String(Ue||"").split(/\s+/)),st=Ue=>{let Us=Pe(Ue);return se.some(A=>Us.has(A))};B=O.filter(Ue=>st(Ue.subject)||st(Ue.object))}}B=B.filter(se=>!BE.has(se.predicate)&&!WE(se)&&!GE.has(se.predicate));let G=B.length>0&&!B.some(vm);if(!B.length)return null;let{findConsistencyViolations:J,TYPE_PREDICATE:ie,SUBCLASS_PREDICATE:de,DISJOINT_PREDICATE:ae}=await Promise.resolve().then(()=>(It(),an)),Z=se=>!se.provenance?.includes("corpus:")&&!se.provenance?.includes("web:"),Y=O.filter(se=>se.predicate===ie&&Z(se)).map(se=>[se.subject,se.object]),te=O.filter(se=>se.predicate===de&&Z(se)).map(se=>[se.subject,se.object]),re=O.filter(se=>se.predicate===ae&&Z(se)).map(se=>[se.subject,se.object]);if(re.length){let Pe=J(Y,te,re,{focus:W,budget:5}).find(st=>W.has(st.subject));if(Pe)return{text:`I can't answer that \u2014 what I've been told about ${Pe.subject} is inconsistent: it's taught to be both ${Pe.classA} and ${Pe.classB}, but ${Pe.viaA} and ${Pe.viaB} are disjoint (${Pe.viaA} owl:disjointWith ${Pe.viaB}). I'd need one of those retracted before I can answer honestly.`,replace:!0}}let Te=await CS(e),fe=await OM(O,W,Te);if(fe)return{text:fe,replace:!0};let Se=B.find(se=>W.has(se.subject)||W.has(se.object)),Le=Se?W.has(Se.subject)?Se.subject:Se.object:V[1].trim(),je=B.some(se=>F.has(se.subject)&&!W.has(se.subject)&&!W.has(se.object));B=at(B,o);let Ye=`${B.length} remembered fact${B.length===1?"":"s"} about ${Le}${je?" (including its known subtypes)":""}:`,{lines:ce,grouped:le}=qE(B,O,W,{indent:" "});if(le)return{...le,text:`${Ye}
218
+ `)+B,replace:!0,...z.length?{pending:{items:z,noun:"facts"}}:{}}}let V=l.match(pM);if(V){let W=ee(a,V[1]),O=await nt(e,r),D=se=>!String(se.provenance||"").includes("corpus:")&&!String(se.provenance||"").includes("web:"),N=O.filter(se=>Ln.has(se.predicate)&&D(se)),F=new Set,z=W;for(let se=0;se<8&&z.size;se+=1){let Pe=new Set;for(let Ue of N)z.has(Ue.object)&&!F.has(Ue.subject)&&Pe.add(Ue.subject);if(!Pe.size)break;for(let Ue of Pe)F.add(Ue);let st=new Set;for(let Ue of Pe)for(let Us of ee(a,Ue))st.add(Us);z=st}let B=O.filter(se=>W.has(se.subject)||W.has(se.object)||F.has(se.subject));if(!B.length){let se=a(V[1]).split(/\s+/).filter(Pe=>Pe.length>=4&&!jS.has(Pe));if(se.length){let Pe=Ue=>new Set(String(Ue||"").split(/\s+/)),st=Ue=>{let Us=Pe(Ue);return se.some(A=>Us.has(A))};B=O.filter(Ue=>st(Ue.subject)||st(Ue.object))}}B=B.filter(se=>!HE.has(se.predicate)&&!qE(se)&&!KE.has(se.predicate));let G=B.length>0&&!B.some(Sm);if(!B.length)return null;let{findConsistencyViolations:J,TYPE_PREDICATE:ie,SUBCLASS_PREDICATE:de,DISJOINT_PREDICATE:ae}=await Promise.resolve().then(()=>(Ot(),an)),Z=se=>!se.provenance?.includes("corpus:")&&!se.provenance?.includes("web:"),Y=O.filter(se=>se.predicate===ie&&Z(se)).map(se=>[se.subject,se.object]),te=O.filter(se=>se.predicate===de&&Z(se)).map(se=>[se.subject,se.object]),re=O.filter(se=>se.predicate===ae&&Z(se)).map(se=>[se.subject,se.object]);if(re.length){let Pe=J(Y,te,re,{focus:W,budget:5}).find(st=>W.has(st.subject));if(Pe)return{text:`I can't answer that \u2014 what I've been told about ${Pe.subject} is inconsistent: it's taught to be both ${Pe.classA} and ${Pe.classB}, but ${Pe.viaA} and ${Pe.viaB} are disjoint (${Pe.viaA} owl:disjointWith ${Pe.viaB}). I'd need one of those retracted before I can answer honestly.`,replace:!0}}let Ae=await LS(e),fe=await GM(O,W,Ae);if(fe)return{text:fe,replace:!0};let Se=B.find(se=>W.has(se.subject)||W.has(se.object)),Le=Se?W.has(Se.subject)?Se.subject:Se.object:V[1].trim(),je=B.some(se=>F.has(se.subject)&&!W.has(se.subject)&&!W.has(se.object));B=at(B,o);let Ye=`${B.length} remembered fact${B.length===1?"":"s"} about ${Le}${je?" (including its known subtypes)":""}:`,{lines:ce,grouped:le}=JE(B,O,W,{indent:" "});if(le)return{...le,text:`${Ye}
219
219
  ${le.text}`,...G?{weakOnly:!0}:{}};let pe=ce.slice(0,Re),Xe=ce.slice(Re),wt=Xe.length?`
220
220
  \u2026and ${Xe.length} more \u2014 say 'more' to see them.`:"";return{text:`${Ye}
221
221
  ${pe.join(`
222
- `)}${wt}`,replace:!0,...Xe.length?{pending:{items:Xe.map(se=>se.trim()),noun:"facts"}}:{},...G?{weakOnly:!0}:{}}}return null}async function XM(e,t){let n=await fa(e,t);if(!n)return null;let s=(e?.byId?.get?.(n.id)||(e?.individuals||[]).find(i=>i?.id===n.id))?.class;if(!s)return null;let{defaultCodeLaneVocab:o}=await Promise.resolve().then(()=>(Jp(),iE)),{classLabels:r}=await o();return r[s]?r[s][0]:null}function Wl(e,t){let n=[];if(!e||!t)return n;let s=new Set([t]),o=t;for(let r=0;r<QM;r+=1){let i=null;for(let a of e.relations||[])if(JM.test(`${a?.prop||""} ${a?.predicate||""}`)&&(i=(a.edges||[]).find(c=>c?.subject===o)||null,i))break;if(!i||s.has(i.object))break;s.add(i.object),n.push({id:i.object,label:i.objectLabel||i.object}),o=i.object}return n}async function TS(e,t,n,s,o=null,r=null,i={},a=null){return _S(await ZM(e,t,n,s,o,r,i,a),n,t)}async function ZM(e,t,n,s,o=null,r=null,i={},a=null){if(!s)return null;let c;try{({normFactTerm:c}=await Promise.resolve().then(()=>(qe(),Ms)))}catch{return null}let l=String(t).trim();if(o){let O=l.match(po);if(O){let D=await fa(o,O[1]);if(D){let N=ee(c,pn(O[2])),F=Wl(o,D.id).find(B=>[...ee(c,B.label)].some(G=>N.has(G)));if(F)return{text:`yes \u2014 the code graph says ${D.label} inherits ${F.label}.`,replace:!0};let z=await fa(o,pn(O[2]));if(z&&Wl(o,z.id).some(B=>B.id===D.id))return{text:`I can't confirm that \u2014 the code graph's stored direction runs the other way: ${z.label} inherits ${D.label}. An inheritance doesn't reverse.`,replace:!0,miss:!0}}}}let u=l.replace(/^(?:actually|really|honestly|yeah\s+nah)\s*,?\s+/i,""),d=await nt(e,a);if(!d.length){if(!po.test(u)&&!Sm.test(u)){let D=u.match(oS);if(D){let N=D[1].trim(),F=Ds.test(N)?r||null:N;if(F&&!/^there\b/i.test(F)&&!n?.parsed&&!iS.test(N)&&!rS.test(N)&&!UE.test(D[2].trim()))return aS(F,D[2].trim().toLowerCase())}}let O=u.match(po)||jm(l);if(!(O&&!/^there\b/i.test(O[1].trim())||YE.test(l)))return null}let p=d.filter(O=>On.has(O.predicate)),f=(O,D)=>D.trust-O.trust,m=O=>{let D=O.map(oe),N=D.slice(0,Re),F=D.slice(Re),z=F.length?`
222
+ `)}${wt}`,replace:!0,...Xe.length?{pending:{items:Xe.map(se=>se.trim()),noun:"facts"}}:{},...G?{weakOnly:!0}:{}}}return null}async function aF(e,t){let n=await ha(e,t);if(!n)return null;let s=(e?.byId?.get?.(n.id)||(e?.individuals||[]).find(i=>i?.id===n.id))?.class;if(!s)return null;let{defaultCodeLaneVocab:o}=await Promise.resolve().then(()=>(em(),uE)),{classLabels:r}=await o();return r[s]?r[s][0]:null}function Vl(e,t){let n=[];if(!e||!t)return n;let s=new Set([t]),o=t;for(let r=0;r<lF;r+=1){let i=null;for(let a of e.relations||[])if(cF.test(`${a?.prop||""} ${a?.predicate||""}`)&&(i=(a.edges||[]).find(c=>c?.subject===o)||null,i))break;if(!i||s.has(i.object))break;s.add(i.object),n.push({id:i.object,label:i.objectLabel||i.object}),o=i.object}return n}async function OS(e,t,n,s,o=null,r=null,i={},a=null){return IS(await uF(e,t,n,s,o,r,i,a),n,t)}async function uF(e,t,n,s,o=null,r=null,i={},a=null){if(!s)return null;let c;try{({normFactTerm:c}=await Promise.resolve().then(()=>(qe(),Ms)))}catch{return null}let l=String(t).trim();if(o){let O=l.match(mo);if(O){let D=await ha(o,O[1]);if(D){let N=ee(c,pn(O[2])),F=Vl(o,D.id).find(B=>[...ee(c,B.label)].some(G=>N.has(G)));if(F)return{text:`yes \u2014 the code graph says ${D.label} inherits ${F.label}.`,replace:!0};let z=await ha(o,pn(O[2]));if(z&&Vl(o,z.id).some(B=>B.id===D.id))return{text:`I can't confirm that \u2014 the code graph's stored direction runs the other way: ${z.label} inherits ${D.label}. An inheritance doesn't reverse.`,replace:!0,miss:!0}}}}let u=l.replace(/^(?:actually|really|honestly|yeah\s+nah)\s*,?\s+/i,""),d=await nt(e,a);if(!d.length){if(!mo.test(u)&&!Rm.test(u)){let D=u.match(cS);if(D){let N=D[1].trim(),F=Ds.test(N)?r||null:N;if(F&&!/^there\b/i.test(F)&&!n?.parsed&&!uS.test(N)&&!lS.test(N)&&!VE.test(D[2].trim()))return dS(F,D[2].trim().toLowerCase())}}let O=u.match(mo)||_m(l);if(!(O&&!/^there\b/i.test(O[1].trim())||ZE.test(l)))return null}let p=d.filter(O=>Ln.has(O.predicate)),f=(O,D)=>D.trust-O.trust,m=O=>{let D=O.map(oe),N=D.slice(0,Re),F=D.slice(Re),z=F.length?`
223
223
  \u2026and ${F.length} more \u2014 say 'more' to see them.`:"";return{text:N.join(`
224
- `)+z,replace:!0,...F.length?{pending:{items:F,noun:"facts"}}:{}}};if(YM.test(l)){let O=at(p.length?p:d,i);return O.length?m(O):null}let h=u.match(Sm);if(h){let O=h[1].trim(),D=Ds.test(O)?r||null:O,N=h[2].trim().toLowerCase(),F=h[3].trim();if(D&&!km.has(N)){let z=mm(d),{findIsaChain:B}=await Promise.resolve().then(()=>(It(),an)),G=Te=>{let fe=String(Te||"").trim().toLowerCase(),Se=[];for(let Le of d){let je=ym(Le.predicate);if(!je)continue;if(je===fe){Se.push({fact:Le,aliasFacts:[]});continue}let Ye=hm(B,je,new Set([fe]),z,{maxHops:2});if(!Ye)continue;let ce=Ye.map(le=>d.find(pe=>pe.predicate===Xo&&pe.subject===le.subject&&pe.object===le.object));ce.every(Boolean)&&Se.push({fact:Le,aliasFacts:ce})}return Se},{loadMemory:J,findRuleByName:ie,resolveRelationChase:de}=await Promise.resolve().then(()=>(qe(),Ms)),{findActionPath:ae}=await Promise.resolve().then(()=>(ys(),Ra)),Z=await J(e),te=await de(Z,N,D,F,{relationFactsFor:G,renderFactLine:oe,factPhrase:Zt,factTermVariants:ee,byTrust:f,rows:d,HAS_PROPERTY_PREDICATE:Gl,findActionPath:ae});return te?{text:`yes \u2014 ${te.citation.join("; ")}`,replace:!0}:G(N).length>0||!!ie(Z,N)?{text:`I know the '${N}' relation, but I can't confirm ${D} is the ${N} of ${F} from what you've told me.`,replace:!0}:{text:`I don't know a relation or rule called '${N}' yet.`,replace:!0}}}let g=Kl(u).match(xS)||ES(u,O=>{let D=ee(c,O);return d.some(N=>D.has(N.subject)||D.has(N.object))});if(g){let O=g[1].trim().toLowerCase(),D=g[2].trim(),N=Ds.test(D)?r||null:D;if(N&&!km.has(O)){let F=mm(d),{findIsaChain:z}=await Promise.resolve().then(()=>(It(),an)),B=Te=>{let fe=String(Te||"").trim().toLowerCase(),Se=[];for(let Le of d){let je=ym(Le.predicate);if(!je)continue;if(je===fe){Se.push({fact:Le,aliasFacts:[]});continue}let Ye=hm(z,je,new Set([fe]),F,{maxHops:2});if(!Ye)continue;let ce=Ye.map(le=>d.find(pe=>pe.predicate===Xo&&pe.subject===le.subject&&pe.object===le.object));ce.every(Boolean)&&Se.push({fact:Le,aliasFacts:ce})}return Se},{loadMemory:G,findRuleByName:J,resolveRelationChaseReverse:ie}=await Promise.resolve().then(()=>(qe(),Ms)),de=await G(e),{findReachableSet:ae}=await Promise.resolve().then(()=>(ys(),Ra)),Y=await ie(de,O,N,{relationFactsFor:B,renderFactLine:oe,factPhrase:Zt,factTermVariants:ee,byTrust:f,rows:d,HAS_PROPERTY_PREDICATE:Gl,findReachableSet:ae});return Y.length?{text:Y.map(fe=>`${fe.subject} \u2014 ${fe.citation.join("; ")}`).join(`
225
- `),replace:!0}:B(O).length>0||!!J(de,O)?{text:/^what\b/i.test(Kl(u))?`I don't know what the ${O} of ${N} is from what you've told me.`:`I don't know anyone who is the ${O} of ${N} from what you've told me.`,replace:!0}:{text:`I don't know a relation or rule called '${O}' yet.`,replace:!0}}}{let O=u.match(eF);if(O){let D=ee(c,O[1]),N=at(d.filter(F=>D.has(F.subject)||D.has(F.object)),i);if(N.length){let F=N.map(oe),z=F.slice(0,Re),B=F.slice(Re),G=B.length?`
224
+ `)+z,replace:!0,...F.length?{pending:{items:F,noun:"facts"}}:{}}};if(iF.test(l)){let O=at(p.length?p:d,i);return O.length?m(O):null}let h=u.match(Rm);if(h){let O=h[1].trim(),D=Ds.test(O)?r||null:O,N=h[2].trim().toLowerCase(),F=h[3].trim();if(D&&!Tm.has(N)){let z=bm(d),{findIsaChain:B}=await Promise.resolve().then(()=>(Ot(),an)),G=Ae=>{let fe=String(Ae||"").trim().toLowerCase(),Se=[];for(let Le of d){let je=xm(Le.predicate);if(!je)continue;if(je===fe){Se.push({fact:Le,aliasFacts:[]});continue}let Ye=wm(B,je,new Set([fe]),z,{maxHops:2});if(!Ye)continue;let ce=Ye.map(le=>d.find(pe=>pe.predicate===Jo&&pe.subject===le.subject&&pe.object===le.object));ce.every(Boolean)&&Se.push({fact:Le,aliasFacts:ce})}return Se},{loadMemory:J,findRuleByName:ie,resolveRelationChase:de}=await Promise.resolve().then(()=>(qe(),Ms)),{findActionPath:ae}=await Promise.resolve().then(()=>(ys(),Aa)),Z=await J(e),te=await de(Z,N,D,F,{relationFactsFor:G,renderFactLine:oe,factPhrase:en,factTermVariants:ee,byTrust:f,rows:d,HAS_PROPERTY_PREDICATE:Hl,findActionPath:ae});return te?{text:`yes \u2014 ${te.citation.join("; ")}`,replace:!0}:G(N).length>0||!!ie(Z,N)?{text:`I know the '${N}' relation, but I can't confirm ${D} is the ${N} of ${F} from what you've told me.`,replace:!0}:{text:`I don't know a relation or rule called '${N}' yet.`,replace:!0}}}let g=Xl(u).match(kS)||RS(u,O=>{let D=ee(c,O);return d.some(N=>D.has(N.subject)||D.has(N.object))});if(g){let O=g[1].trim().toLowerCase(),D=g[2].trim(),N=Ds.test(D)?r||null:D;if(N&&!Tm.has(O)){let F=bm(d),{findIsaChain:z}=await Promise.resolve().then(()=>(Ot(),an)),B=Ae=>{let fe=String(Ae||"").trim().toLowerCase(),Se=[];for(let Le of d){let je=xm(Le.predicate);if(!je)continue;if(je===fe){Se.push({fact:Le,aliasFacts:[]});continue}let Ye=wm(z,je,new Set([fe]),F,{maxHops:2});if(!Ye)continue;let ce=Ye.map(le=>d.find(pe=>pe.predicate===Jo&&pe.subject===le.subject&&pe.object===le.object));ce.every(Boolean)&&Se.push({fact:Le,aliasFacts:ce})}return Se},{loadMemory:G,findRuleByName:J,resolveRelationChaseReverse:ie}=await Promise.resolve().then(()=>(qe(),Ms)),de=await G(e),{findReachableSet:ae}=await Promise.resolve().then(()=>(ys(),Aa)),Y=await ie(de,O,N,{relationFactsFor:B,renderFactLine:oe,factPhrase:en,factTermVariants:ee,byTrust:f,rows:d,HAS_PROPERTY_PREDICATE:Hl,findReachableSet:ae});return Y.length?{text:Y.map(fe=>`${fe.subject} \u2014 ${fe.citation.join("; ")}`).join(`
225
+ `),replace:!0}:B(O).length>0||!!J(de,O)?{text:/^what\b/i.test(Xl(u))?`I don't know what the ${O} of ${N} is from what you've told me.`:`I don't know anyone who is the ${O} of ${N} from what you've told me.`,replace:!0}:{text:`I don't know a relation or rule called '${O}' yet.`,replace:!0}}}{let O=u.match(dF);if(O){let D=ee(c,O[1]),N=at(d.filter(F=>D.has(F.subject)||D.has(F.object)),i);if(N.length){let F=N.map(oe),z=F.slice(0,Re),B=F.slice(Re),G=B.length?`
226
226
  \u2026and ${B.length} more \u2014 say 'more' to see them.`:"";return{text:z.join(`
227
- `)+G,replace:!0,...B.length?{pending:{items:B,noun:"facts"}}:{}}}}}let b=u.match(QP);if(b){let O=Cm(b[1].trim().toLowerCase()),D=b[2].trim(),N=Ds.test(D)?r||null:D;if(N){let{loadMemory:F,findRuleByName:z,RULE_KIND_PROP:B,RULE_KIND_RECURSIVE:G}=await Promise.resolve().then(()=>(qe(),Ms)),J=await F(e),ie=z(J,O),de=ie?.attributes?.find(ae=>ae.prop===B)?.value;if(ie&&de===G){let ae=ie.attributes.find(te=>te.prop==="mgx:ruleBaseCase")?.value,Z=ie.attributes.find(te=>te.prop==="mgx:ruleRecStep")?.value,Y=c(N);if(ae&&Z&&Y){let te=mm(d),{findIsaChain:re}=await Promise.resolve().then(()=>(It(),an)),Te=Ye=>{let ce=String(Ye||"").trim().toLowerCase(),le=[];for(let pe of d){let Xe=ym(pe.predicate);if(!Xe)continue;if(Xe===ce){le.push({fact:pe,aliasFacts:[]});continue}let wt=hm(re,Xe,new Set([ce]),te,{maxHops:2});if(!wt)continue;let se=wt.map(Pe=>d.find(st=>st.predicate===Xo&&st.subject===Pe.subject&&st.object===Pe.object));se.every(Boolean)&&le.push({fact:pe,aliasFacts:se})}return le},{findReachableSet:fe}=await Promise.resolve().then(()=>(ys(),Ra)),je=fe({entity:Y,hop:0},Ye=>{let ce=Ye.hop===0?ae:Z;return Te(ce).filter(le=>le.fact.subject===Ye.entity).map(le=>({action:le,nextState:{entity:le.fact.object,hop:Ye.hop+1}}))},{maxDepth:20,stateKey:Ye=>Ye.entity});if(je.length)return{text:je.map(({node:ce,path:le})=>{let pe=new Set,Xe=[];for(let wt of le.actions){Xe.push(oe(wt.fact));for(let se of wt.aliasFacts){let Pe=se.id||`${se.subject}|${se.predicate}|${se.object}`;pe.has(Pe)||(pe.add(Pe),Xe.push(`${Zt(se)}${se.provenance?` (source: ${ms(se.provenance)})`:""}`))}}return`${ce.entity} \u2014 ${Xe.join("; ")}`}).join(`
228
- `),replace:!0}}}return null}}let y=l.match(YE),$=l.match(po)||jm(l)||y&&`is ${y[1].trim()} a ${y[2].trim()}`.match(po);if($){let O=ee(c,pn($[2])),D=r&&Ds.test($[1].trim())?r:$[1],N=new Set(ee(c,D));if([...N].some(K=>O.has(K))){let K=pn($[2]).trim();return{text:`yes \u2014 ${Jo(K)} ${K} is ${Jo(K)} ${K}, trivially: every kind is a kind of itself.`,replace:!0}}let F=await XM(o,D);if(F)for(let K of ee(c,F))N.add(K);let{findIsaChain:z,buildSubClassSuccessors:B,deriveDisjointViolations:G,SUBCLASS_PREDICATE:J,TYPE_PREDICATE:ie,DISJOINT_PREDICATE:de}=await Promise.resolve().then(()=>(It(),an)),ae=Yo,Z=p.filter(K=>K.predicate===J&&ae(K)),Y=p.filter(K=>K.predicate===ie&&ae(K)),te=Z.map(K=>[K.subject,K.object]),re=Y.map(K=>[K.subject,K.object]),Te=p.filter(K=>K.predicate===J),fe=p.filter(K=>K.predicate===ie),Se=fe.map(K=>[K.subject,K.object]),Le=Te.map(K=>[K.subject,K.object]),je=B(te),Ye=B(Le),ce=d.filter(K=>K.predicate===de&&ae(K)),le=ce.map(K=>[K.subject,K.object]),pe=ce.length?G(Se.concat(Le),Le,le,{budget:20,focus:new Set([...N,...O])}):[],Xe=K=>{let xe=pe.find(Me=>Me.subject===K&&O.has(Me.object));if(!xe)return null;let be=p.filter(Me=>O.has(Me.object)&&(Me.subject===xe.viaClass||Me.subject===xe.subject)).sort(f)[0],ke=ce.find(Me=>Me.subject===xe.viaClass&&Me.object===xe.object||Me.subject===xe.object&&Me.object===xe.viaClass);return!be||!ke?null:VP(be,ke)},wt=p.filter(K=>N.has(K.subject)&&O.has(K.object)).sort(f)[0],se=d.filter(K=>K.predicate===rc&&N.has(K.subject)&&O.has(K.object)).sort(f)[0],Pe=ce.find(K=>N.has(K.subject)&&O.has(K.object)||N.has(K.object)&&O.has(K.subject));if(wt&&!se){let K=Xe(wt.subject);if(K)return K}let st=$S(wt,se||Pe);if(st)return st;if(ce.length){let K=ke=>{let Me=new Set(ke),Ot=new Set(ke);for(let Fe=0;Fe<8&&Ot.size;Fe+=1){let we=new Set;for(let[Ve,mo]of Le)Ot.has(Ve)&&!Me.has(mo)&&we.add(mo);if(!we.size)break;for(let Ve of we)Me.add(Ve);Ot=we}return Me},xe=K(O),be=pe.find(ke=>N.has(ke.subject)&&xe.has(ke.object)&&!K([ke.viaClass]).has(ke.object)&&!K([ke.object]).has(ke.viaClass));if(be){let ke=p.filter(we=>N.has(we.subject)&&we.object===be.viaClass).sort(f)[0],Me=ce.find(we=>we.subject===be.viaClass&&we.object===be.object||we.subject===be.object&&we.object===be.viaClass),Ot=!O.has(be.object),Fe=Ot?p.filter(we=>O.has(we.subject)&&we.object===be.object).sort(f)[0]:null;if(ke&&Me&&(!Ot||Fe)){let we=pn($[2]).trim();return{text:`no \u2014 ${[ke,...Fe?[Fe]:[]].map(oe).join("; ")}; and ${Zt(Me)}${Me.provenance?` (source: ${ms(Me.provenance)})`:""} \u2014 so ${D} can never be ${Jo(we)} ${we}.`,replace:!0}}}}let Ue=await fa(o,D);if(Ue){let K=new Map;for(let be of Wl(o,Ue.id))for(let ke of ee(c,be.label))!N.has(ke)&&!K.has(ke)&&K.set(ke,be.label);let xe=p.filter(be=>K.has(be.subject)&&O.has(be.object)).sort(f)[0];if(xe)return{text:`yes \u2014 the code graph says ${Ue.label} inherits ${K.get(xe.subject)}, and ${oe(xe)}`,replace:!0}}let Us=K=>(K.predicate===J?Z:Y).find(xe=>xe.subject===K.subject&&xe.object===K.object);for(let K of N){let xe=z(K,O,re,je,{maxHops:2});if(!xe)continue;let be=Xe(K);if(be)return be;let ke=xe.map(Us);if(ke.every(Boolean))return{text:`yes \u2014 ${zl(ke)}`,replace:!0}}let A=K=>(K.predicate===J?Te:fe).find(xe=>xe.subject===K.subject&&xe.object===K.object);for(let K of N){let xe=z(K,O,Se,Ye,{maxHops:2});if(!xe)continue;let be=Xe(K);if(be)return be;let ke=xe.map(A);if(ke.every(Boolean)&&ke.some(ae))return{text:`yes \u2014 ${zl(ke)}`,replace:!0}}let he=D.match(/^(.*\S)\s+not$/i),Ie=he&&[he[0],r&&Ds.test(he[1].trim())?r:he[1]];if(Ie){let K=ee(c,Ie[1]),xe=O,be=p.filter(Fe=>K.has(Fe.subject)&&xe.has(Fe.object)).sort(f)[0];if(be)return{text:`no \u2014 ${oe(be)}`,replace:!0};let ke=ce.find(Fe=>K.has(Fe.subject)&&xe.has(Fe.object)||K.has(Fe.object)&&xe.has(Fe.subject));if(ke)return{text:`yes \u2014 ${oe(ke)}`,replace:!0};let Me=Ie[1].trim(),Ot=pn($[2]).trim();return{text:`I can't confirm that either way \u2014 nothing I remember links ${Me} and ${Ot}. If no ${Me} is a ${Ot}, teach me: "no ${Me} is a ${Ot}".`,replace:!0,miss:!0}}if(ce.length){let K=G(re.concat(te),te,le,{budget:10});for(let xe of N){let be=K.find(Fe=>Fe.subject===xe&&O.has(Fe.object));if(!be)continue;let ke=Y.concat(Z).find(Fe=>Fe.subject===be.subject&&Fe.object===be.viaType),Me=ce.find(Fe=>Fe.subject===be.viaClass&&Fe.object===be.object||Fe.subject===be.object&&Fe.object===be.viaClass),Ot=[ke,Me].filter(Boolean).map(oe);return{text:`no \u2014 ${Ot.length?Ot.join("; "):`${be.viaClass} and ${be.object} are disjoint.`}`,replace:!0}}}let{deriveSomeValuesFromApplication:hs,ON_PROPERTY_PREDICATE:gs,SOME_VALUES_FROM_PREDICATE:pa,deriveSomeValuesFromSubsumption:YS,ENTAILED_SCM_SVF_PROVENANCE:XS,SCM_SVF_RULE_CONFIDENCE:JS,entailedTrustFrom:Lm}=await Promise.resolve().then(()=>(It(),an)),Pm=d.filter(K=>K.predicate===gs&&ae(K)),Mm=d.filter(K=>K.predicate===pa&&ae(K));if(Pm.length&&Mm.length){let K=new Map(Mm.map(we=>[we.subject,we.object])),xe=Pm.map(we=>({restriction:we.subject,property:we.object,target:K.get(we.subject)})).filter(we=>we.target),be=new Set([J,ie,de,gs,pa,"owl:intersectionOf"]),ke=d.filter(we=>ae(we)&&!be.has(we.predicate)),Me=ke.map(we=>[we.subject,we.predicate,we.object]),Ot=hs(Me,re,te,xe,{budget:10});for(let we of N){let Ve=Ot.find(Nn=>Nn.subject===we&&O.has(Nn.object));if(!Ve)continue;let mo=ke.find(Nn=>Nn.subject===Ve.subject&&Nn.predicate===Ve.viaProperty&&Nn.object===Ve.viaValue),ho=Y.find(Nn=>Nn.subject===Ve.viaValue&&Nn.object===Ve.viaType),Xr=[mo,ho].filter(Boolean).map(oe);return{text:`yes \u2014 ${Xr.length?Xr.join("; "):`${Ve.subject} ${Ve.viaProperty} ${Ve.viaValue}, and ${Ve.viaValue} is a ${Ve.viaType}.`}`,replace:!0}}let Fe=xe.length>1?YS(xe,te,{budget:10}):[];if(Fe.length){let we=B(te.concat(Fe.map(Ae=>[Ae.subject,Ae.object]))),Ve=new Map(xe.map(Ae=>[Ae.restriction,Ae])),mo=new Map;for(let Ae of d)mo.set(`${Ae.subject}\0${Ae.predicate}\0${Ae.object}`,Ae.trust);let ho=(Ae,Gn,en)=>mo.get(`${Ae}\0${Gn}\0${en}`),Xr=new Map;for(let Ae of Fe){let Gn=Ve.get(Ae.subject),en=Ve.get(Ae.object),dn=[Gn&&ho(Ae.subject,gs,Gn.property),ho(Ae.subject,pa,Ae.viaY1),en&&ho(Ae.object,gs,en.property),ho(Ae.object,pa,Ae.viaY2),ho(Ae.viaY1,J,Ae.viaY2)].filter(ej=>typeof ej=="number"),ma=Lm(dn,JS);ma!==null&&Xr.set(`${Ae.subject}\0${Ae.object}`,ma)}let Nn=Ae=>{if(Ae.predicate!==J)return Y.find(dn=>dn.subject===Ae.subject&&dn.object===Ae.object);let Gn=Z.find(dn=>dn.subject===Ae.subject&&dn.object===Ae.object);if(Gn)return Gn;let en=Fe.find(dn=>dn.subject===Ae.subject&&dn.object===Ae.object);return en?{subject:en.subject,predicate:J,object:en.object,provenance:XS,trust:Xr.get(`${en.subject}\0${en.object}`)}:void 0};for(let Ae of N){let Gn=z(Ae,O,re,we,{maxHops:3});if(!Gn)continue;let en=Gn.map(Nn);if(en.every(Boolean)){let dn=Lm(en.map(ma=>ma.trust),1);return{text:`yes \u2014 ${zl(en)}`,replace:!0,...dn!==null?{trust:dn}:{}}}}}}let QS=ee(c,D),eu=p.filter(K=>QS.has(K.subject)).sort(f),$n=D.trim(),Bs=pn($[2]).trim(),ZS=[...N].some(K=>z(K,O,re,je,{maxHops:ZP})),tu=await MM(e,a,d,$n,N,O,Bs);if(tu?.text)return tu;let nu=!!tu?.budgetExhausted;if(eu.length){let K=eu.slice(0,3).map(oe).join("; "),{ON_PROPERTY_PREDICATE:xe,SOME_VALUES_FROM_PREDICATE:be}=await Promise.resolve().then(()=>(It(),an)),ke=new Set,Me=new Set;for(let Ve of d)Ve.predicate===xe?ke.add(Ve.subject):Ve.predicate===be&&Me.add(Ve.subject);let Ot=new Set([...ke].filter(Ve=>Me.has(Ve))),we=eu.some(Ve=>Ot.has(Ve.object))?`The facts to settle it are here, but reaching it means composing a restriction /syllogise doesn't follow. Run "/classify ${$n}", then ask me again.`:ZS?`The facts to settle it are here, but the chain is longer than I follow while answering. Run "/syllogise ${$n}", then ask me again.`:`If it's true, teach me: "${$n} is a kind of ${Bs}". If it isn't, teach me: "no ${$n} is a ${Bs}".`;return{text:`I can't confirm that \u2014 nothing I remember says ${$n} is a ${Bs}. I do know: ${K}. ${we}`,replace:!0,miss:!0,...nu?{budgetExhausted:!0}:{}}}let Fm=p.filter(K=>N.has(K.object)&&O.has(K.subject)).sort(f)[0];return Fm?{text:`I can't confirm that \u2014 what I know runs the other way: ${oe(Fm)}. A kind doesn't reverse. If it's true, teach me: "every ${$n} is a ${Bs}". If it isn't, teach me: "no ${$n} is a ${Bs}".`,replace:!0,miss:!0,...nu?{budgetExhausted:!0}:{}}:!Ue&&!F&&!bP($n)&&!d.some(K=>N.has(K.subject)||N.has(K.object))?{text:`I can't confirm that \u2014 I don't know "${$n}" at all yet. If it's true, teach me: "${$n} is a kind of ${Bs}". If it isn't, teach me: "no ${$n} is a ${Bs}".`,replace:!0,miss:!0,...nu?{budgetExhausted:!0}:{}}:null}let E=l.match(UM);if(E){let[,O,D,N]=E,{SUBCLASS_PREDICATE:F,ON_PROPERTY_PREDICATE:z,buildCardinalityRestrictions:B,proveCardinalityAtLeast:G,CARDINALITY_RULE_CONFIDENCE:J,entailedTrustFrom:ie}=await Promise.resolve().then(()=>(It(),an)),de=Yo,ae=p.filter(te=>te.predicate===F&&de(te)).map(te=>[te.subject,te.object]),Z=d.filter(te=>(te.predicate===z||sS.has(te.predicate))&&de(te)),Y=B(Z);if(Y.length){let te=ee(c,O.trim()),re=ee(c,N.trim()),Te=Number(D),fe=KE(te,re,(Se,Le)=>G(ae,Y,Se,Le,Te,{}));if(fe){let Se=d.find(pe=>pe.predicate===F&&pe.subject===fe.viaClass&&pe.object===fe.viaRestriction),Le=Se?.provenance?` (source: ${ms(Se.provenance)})`:"",je=fe.kind==="exactly"?"exactly":"at least",Ye=(pe,Xe)=>`${pe}${Xe===1?"":"s"}`,ce=[Se?.trust,...Z.filter(pe=>pe.subject===fe.viaRestriction).map(pe=>pe.trust),...fe.viaClass!==fe.subject?[p.find(pe=>pe.predicate===F&&pe.subject===fe.subject&&pe.object===fe.viaClass)?.trust]:[]].filter(pe=>typeof pe=="number"),le=ie(ce,J);return{text:`yes \u2014 every ${fe.viaClass} has ${je} ${fe.n} ${Ye(fe.object,fe.n)}${Le}, so at least ${Te} follows.`,replace:!0,...le!==null?{trust:le}:{}}}}}let _=l.match(BM);if(_){let[,O,D]=_,{SUBCLASS_PREDICATE:N,ON_PROPERTY_PREDICATE:F,buildCardinalityRestrictions:z,proveMaxCardinalityZeroDenial:B,CAX_MAXC0_RULE_CONFIDENCE:G,entailedTrustFrom:J}=await Promise.resolve().then(()=>(It(),an)),ie=Yo,de=p.filter(Y=>Y.predicate===N&&ie(Y)).map(Y=>[Y.subject,Y.object]),ae=d.filter(Y=>(Y.predicate===F||sS.has(Y.predicate))&&ie(Y)),Z=z(ae);if(Z.length){let Y=ee(c,O.trim()),te=ee(c,D.trim()),re=KE(Y,te,(Te,fe)=>B(de,Z,Te,fe,{}));if(re){let Te=d.find(je=>je.predicate===N&&je.subject===re.viaClass&&je.object===re.viaRestriction),fe=Te?.provenance?` (source: ${ms(Te.provenance)})`:"",Se=[Te?.trust,...ae.filter(je=>je.subject===re.viaRestriction).map(je=>je.trust),...re.viaClass!==re.subject?[p.find(je=>je.predicate===N&&je.subject===re.subject&&je.object===re.viaClass)?.trust]:[]].filter(je=>typeof je=="number"),Le=J(Se,G);return{text:`no \u2014 every ${re.viaClass} has at most 0 ${re.object}${fe}.`,replace:!0,...Le!==null?{trust:Le}:{}}}}}let v=l.match(WM);if(v){let O=ee(c,v[1]),D=d.filter(N=>N.predicate===pm&&O.has(N.subject)).sort(f);return D.length?m(D):null}let S=u.match(GM);if(S){let[,O,D]=S,N=ee(c,O.trim()),F=ee(c,D.replace(/^an?\s+/i,"").trim()),z=d.filter(B=>B.predicate===pm&&F.has(B.subject)&&N.has(B.object)).sort(f)[0];return z?{text:`yes \u2014 ${oe(z)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${O.trim().toLowerCase()} owns/maintains ${D.trim()}.`,replace:!0}}let C=u.match(VM);if(C){let[,O,D]=C,N=ee(c,O.replace(/^an?\s+/i,"").trim()),F=ee(c,D.trim()),z=d.filter(B=>B.predicate===pm&&N.has(B.subject)&&F.has(B.object)).sort(f)[0];return z?{text:`yes \u2014 ${oe(z)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${O.trim().toLowerCase()} is owned by ${D.trim()}.`,replace:!0}}let x=u.match(HM);if(x){let[,O,D]=x,N=ee(c,O.trim()),F=ee(c,`${D.trim()} method`),z=d.filter(B=>B.predicate===Mr&&N.has(B.subject)&&F.has(B.object)).sort(f)[0];return z?{text:`yes \u2014 ${oe(z)}`,replace:!0}:null}let R=u.match(qM);if(R){let O=ee(c,R[1].trim()),D=d.filter(N=>N.predicate===Mr&&O.has(N.subject)&&/ method$/.test(N.object)).sort(f);return D.length?m(D):null}let w=u.match(oS);if(w){let O=w[1].trim(),D=iS.test(O)||rS.test(O)?null:Ds.test(O)?r||null:O,N=w[2].trim().toLowerCase();if(D){let F=ee(c,D),z=new Map,B=null;if(o){let Y=await fa(o,D);if(B=Y,Y)for(let te of Wl(o,Y.id))for(let re of ee(c,te.label))!F.has(re)&&!z.has(re)&&z.set(re,te.label),F.add(re)}let G=Y=>Y.predicate===Gl&&c(Y.object)===N||Y.predicate===`tmct:${N}`&&Y.object==="true",J=c(D).split(/\s+/).filter(Y=>Y.length>=4&&!vS.has(Y)),ie=Y=>J.some(te=>new Set(String(Y.subject||"").split(/\s+/)).has(te)),de=Y=>F.has(Y.subject)||J.length&&ie(Y),ae=d.filter(Y=>de(Y)&&G(Y)).sort(f)[0];if(ae){let Y=z.get(ae.subject);return{text:Y?`yes \u2014 the code graph says ${B.label} inherits ${Y}, and ${oe(ae)}`:`yes \u2014 ${oe(ae)}`,replace:!0}}let Z=jS(d,F,N,c);if(Z)return{text:`yes \u2014 ${Z.map(oe).join("; ")}`,replace:!0};{let{findIsaChain:Y,SUBCLASS_PREDICATE:te,TYPE_PREDICATE:re}=await Promise.resolve().then(()=>(It(),an)),Te=Yo,fe=d.filter(le=>le.predicate===te&&Te(le)),Se=d.filter(le=>le.predicate===re&&Te(le)),Le=fe.map(le=>[le.subject,le.object]),je=Se.map(le=>[le.subject,le.object]),Ye=le=>(le.predicate===te?fe:Se).find(pe=>pe.subject===le.subject&&pe.object===le.object),ce=ee(c,N);for(let le of F){let pe=Y(le,ce,je,Le,{maxHops:2});if(!pe)continue;let Xe=pe.map(Ye);if(Xe.every(Boolean))return{text:`yes \u2014 ${zl(Xe)}`,replace:!0}}}if(d.some(de)&&!n?.parsed)return/^there\b/i.test(D)||KM.test(N)?null:{text:`I don't have a fact saying ${qP(D)} is ${N}.`,replace:!0};if(!n?.parsed&&!UE.test(N))return aS(D,N)}}let T=Hl(l).match(AP);if(T&&!bm.test(l)){let[,O,D,N]=T,F=D.toLowerCase();if(!gm.test(F)&&!wm.test(F)){let z=O.trim(),B=OP(await Vl(F),N),G=B.object.replace(/^an?\s+/i,"").trim();if(z&&G){let J=B.predicate,ie=ee(c,z),de=ee(c,G),ae=[J,kr(J)],Z=d.filter(te=>ae.includes(te.predicate)&&ie.has(te.subject)&&de.has(te.object)).sort(f)[0];if(Z)return{text:`${bw(Z.predicate)?"no":"yes"} \u2014 ${oe(Z)}`,replace:!0,generalVerbQuery:!0};let Y=d.filter(te=>ae.includes(te.predicate)&&ie.has(te.subject));if(Y.length){let te=Y.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${Zt({subject:z,predicate:J,object:G})}. I do know: ${te}.`,replace:!0,miss:!0}}return null}}}let I=l.match(CP);if(I&&!bm.test(l)){let[,O,D]=I,[N,F]=D.toLowerCase().split(/\s+/);if(!gm.test(N)&&!wm.test(N)){let z=O.trim();if(z){let B=await Vl(N);F&&/^mgx:[a-z]+$/.test(B)&&(B=`${B}-${F}`);let G=ee(c,z),J=[B,kr(B)],ie=at(d.filter(de=>J.includes(de.predicate)&&G.has(de.subject)),i);if(ie.length)return{...m(ie),generalVerbQuery:!0}}}}let j=l.match(/^(?:what|who)\s+([a-z]+)\s+(on|in|at|onto|upon|under|over|beside|near|behind|above|below|inside|outside)\s+(.+?)[?.!\s]*$/i);if(j&&!bm.test(l)){let[,O,D,N]=j,F=O.toLowerCase();if(!gm.test(F)&&!wm.test(F)&&!TP.test(F)){let z=await Vl(F);/^mgx:[a-z]+$/.test(z)&&(z=`${z}-${D.toLowerCase()}`);let B=ee(c,N.replace(/^(?:an?|the)\s+/i,"").trim()),G=at(d.filter(J=>J.predicate===z&&B.has(J.object)),i);if(G.length)return{...m(G),generalVerbQuery:!0}}}let k=l.match(DM);if(k){let O=ee(c,k[1]),D=at(d.filter(J=>O.has(J.subject)||O.has(J.object)),i);if(!D.length)return null;let N=O.has(D[0].subject)?D[0].subject:D[0].object,F=D.map(J=>` ${oe(J)}`),z=F.slice(0,Re),B=F.slice(Re),G=B.length?`
227
+ `)+G,replace:!0,...B.length?{pending:{items:B,noun:"facts"}}:{}}}}}let b=u.match(lM);if(b){let O=Nm(b[1].trim().toLowerCase()),D=b[2].trim(),N=Ds.test(D)?r||null:D;if(N){let{loadMemory:F,findRuleByName:z,RULE_KIND_PROP:B,RULE_KIND_RECURSIVE:G}=await Promise.resolve().then(()=>(qe(),Ms)),J=await F(e),ie=z(J,O),de=ie?.attributes?.find(ae=>ae.prop===B)?.value;if(ie&&de===G){let ae=ie.attributes.find(te=>te.prop==="mgx:ruleBaseCase")?.value,Z=ie.attributes.find(te=>te.prop==="mgx:ruleRecStep")?.value,Y=c(N);if(ae&&Z&&Y){let te=bm(d),{findIsaChain:re}=await Promise.resolve().then(()=>(Ot(),an)),Ae=Ye=>{let ce=String(Ye||"").trim().toLowerCase(),le=[];for(let pe of d){let Xe=xm(pe.predicate);if(!Xe)continue;if(Xe===ce){le.push({fact:pe,aliasFacts:[]});continue}let wt=wm(re,Xe,new Set([ce]),te,{maxHops:2});if(!wt)continue;let se=wt.map(Pe=>d.find(st=>st.predicate===Jo&&st.subject===Pe.subject&&st.object===Pe.object));se.every(Boolean)&&le.push({fact:pe,aliasFacts:se})}return le},{findReachableSet:fe}=await Promise.resolve().then(()=>(ys(),Aa)),je=fe({entity:Y,hop:0},Ye=>{let ce=Ye.hop===0?ae:Z;return Ae(ce).filter(le=>le.fact.subject===Ye.entity).map(le=>({action:le,nextState:{entity:le.fact.object,hop:Ye.hop+1}}))},{maxDepth:20,stateKey:Ye=>Ye.entity});if(je.length)return{text:je.map(({node:ce,path:le})=>{let pe=new Set,Xe=[];for(let wt of le.actions){Xe.push(oe(wt.fact));for(let se of wt.aliasFacts){let Pe=se.id||`${se.subject}|${se.predicate}|${se.object}`;pe.has(Pe)||(pe.add(Pe),Xe.push(`${en(se)}${se.provenance?` (source: ${ms(se.provenance)})`:""}`))}}return`${ce.entity} \u2014 ${Xe.join("; ")}`}).join(`
228
+ `),replace:!0}}}return null}}let y=l.match(ZE),$=l.match(mo)||_m(l)||y&&`is ${y[1].trim()} a ${y[2].trim()}`.match(mo);if($){let O=ee(c,pn($[2])),D=r&&Ds.test($[1].trim())?r:$[1],N=new Set(ee(c,D));if([...N].some(K=>O.has(K))){let K=pn($[2]).trim();return{text:`yes \u2014 ${Qo(K)} ${K} is ${Qo(K)} ${K}, trivially: every kind is a kind of itself.`,replace:!0}}let F=await aF(o,D);if(F)for(let K of ee(c,F))N.add(K);let{findIsaChain:z,buildSubClassSuccessors:B,deriveDisjointViolations:G,SUBCLASS_PREDICATE:J,TYPE_PREDICATE:ie,DISJOINT_PREDICATE:de}=await Promise.resolve().then(()=>(Ot(),an)),ae=Xo,Z=p.filter(K=>K.predicate===J&&ae(K)),Y=p.filter(K=>K.predicate===ie&&ae(K)),te=Z.map(K=>[K.subject,K.object]),re=Y.map(K=>[K.subject,K.object]),Ae=p.filter(K=>K.predicate===J),fe=p.filter(K=>K.predicate===ie),Se=fe.map(K=>[K.subject,K.object]),Le=Ae.map(K=>[K.subject,K.object]),je=B(te),Ye=B(Le),ce=d.filter(K=>K.predicate===de&&ae(K)),le=ce.map(K=>[K.subject,K.object]),pe=ce.length?G(Se.concat(Le),Le,le,{budget:20,focus:new Set([...N,...O])}):[],Xe=K=>{let xe=pe.find(Me=>Me.subject===K&&O.has(Me.object));if(!xe)return null;let be=p.filter(Me=>O.has(Me.object)&&(Me.subject===xe.viaClass||Me.subject===xe.subject)).sort(f)[0],ke=ce.find(Me=>Me.subject===xe.viaClass&&Me.object===xe.object||Me.subject===xe.object&&Me.object===xe.viaClass);return!be||!ke?null:nM(be,ke)},wt=p.filter(K=>N.has(K.subject)&&O.has(K.object)).sort(f)[0],se=d.filter(K=>K.predicate===ac&&N.has(K.subject)&&O.has(K.object)).sort(f)[0],Pe=ce.find(K=>N.has(K.subject)&&O.has(K.object)||N.has(K.object)&&O.has(K.subject));if(wt&&!se){let K=Xe(wt.subject);if(K)return K}let st=SS(wt,se||Pe);if(st)return st;if(ce.length){let K=ke=>{let Me=new Set(ke),Nt=new Set(ke);for(let Fe=0;Fe<8&&Nt.size;Fe+=1){let we=new Set;for(let[Ve,ho]of Le)Nt.has(Ve)&&!Me.has(ho)&&we.add(ho);if(!we.size)break;for(let Ve of we)Me.add(Ve);Nt=we}return Me},xe=K(O),be=pe.find(ke=>N.has(ke.subject)&&xe.has(ke.object)&&!K([ke.viaClass]).has(ke.object)&&!K([ke.object]).has(ke.viaClass));if(be){let ke=p.filter(we=>N.has(we.subject)&&we.object===be.viaClass).sort(f)[0],Me=ce.find(we=>we.subject===be.viaClass&&we.object===be.object||we.subject===be.object&&we.object===be.viaClass),Nt=!O.has(be.object),Fe=Nt?p.filter(we=>O.has(we.subject)&&we.object===be.object).sort(f)[0]:null;if(ke&&Me&&(!Nt||Fe)){let we=pn($[2]).trim();return{text:`no \u2014 ${[ke,...Fe?[Fe]:[]].map(oe).join("; ")}; and ${en(Me)}${Me.provenance?` (source: ${ms(Me.provenance)})`:""} \u2014 so ${D} can never be ${Qo(we)} ${we}.`,replace:!0}}}}let Ue=await ha(o,D);if(Ue){let K=new Map;for(let be of Vl(o,Ue.id))for(let ke of ee(c,be.label))!N.has(ke)&&!K.has(ke)&&K.set(ke,be.label);let xe=p.filter(be=>K.has(be.subject)&&O.has(be.object)).sort(f)[0];if(xe)return{text:`yes \u2014 the code graph says ${Ue.label} inherits ${K.get(xe.subject)}, and ${oe(xe)}`,replace:!0}}let Us=K=>(K.predicate===J?Z:Y).find(xe=>xe.subject===K.subject&&xe.object===K.object);for(let K of N){let xe=z(K,O,re,je,{maxHops:2});if(!xe)continue;let be=Xe(K);if(be)return be;let ke=xe.map(Us);if(ke.every(Boolean))return{text:`yes \u2014 ${Bl(ke)}`,replace:!0}}let A=K=>(K.predicate===J?Ae:fe).find(xe=>xe.subject===K.subject&&xe.object===K.object);for(let K of N){let xe=z(K,O,Se,Ye,{maxHops:2});if(!xe)continue;let be=Xe(K);if(be)return be;let ke=xe.map(A);if(ke.every(Boolean)&&ke.some(ae))return{text:`yes \u2014 ${Bl(ke)}`,replace:!0}}let he=D.match(/^(.*\S)\s+not$/i),Oe=he&&[he[0],r&&Ds.test(he[1].trim())?r:he[1]];if(Oe){let K=ee(c,Oe[1]),xe=O,be=p.filter(Fe=>K.has(Fe.subject)&&xe.has(Fe.object)).sort(f)[0];if(be)return{text:`no \u2014 ${oe(be)}`,replace:!0};let ke=ce.find(Fe=>K.has(Fe.subject)&&xe.has(Fe.object)||K.has(Fe.object)&&xe.has(Fe.subject));if(ke)return{text:`yes \u2014 ${oe(ke)}`,replace:!0};let Me=Oe[1].trim(),Nt=pn($[2]).trim();return{text:`I can't confirm that either way \u2014 nothing I remember links ${Me} and ${Nt}. If no ${Me} is a ${Nt}, teach me: "no ${Me} is a ${Nt}".`,replace:!0,miss:!0}}if(ce.length){let K=G(re.concat(te),te,le,{budget:10});for(let xe of N){let be=K.find(Fe=>Fe.subject===xe&&O.has(Fe.object));if(!be)continue;let ke=Y.concat(Z).find(Fe=>Fe.subject===be.subject&&Fe.object===be.viaType),Me=ce.find(Fe=>Fe.subject===be.viaClass&&Fe.object===be.object||Fe.subject===be.object&&Fe.object===be.viaClass),Nt=[ke,Me].filter(Boolean).map(oe);return{text:`no \u2014 ${Nt.length?Nt.join("; "):`${be.viaClass} and ${be.object} are disjoint.`}`,replace:!0}}}let{deriveSomeValuesFromApplication:hs,ON_PROPERTY_PREDICATE:gs,SOME_VALUES_FROM_PREDICATE:ga,deriveSomeValuesFromSubsumption:ZS,ENTAILED_SCM_SVF_PROVENANCE:ej,SCM_SVF_RULE_CONFIDENCE:tj,entailedTrustFrom:Fm}=await Promise.resolve().then(()=>(Ot(),an)),Dm=d.filter(K=>K.predicate===gs&&ae(K)),zm=d.filter(K=>K.predicate===ga&&ae(K));if(Dm.length&&zm.length){let K=new Map(zm.map(we=>[we.subject,we.object])),xe=Dm.map(we=>({restriction:we.subject,property:we.object,target:K.get(we.subject)})).filter(we=>we.target),be=new Set([J,ie,de,gs,ga,"owl:intersectionOf"]),ke=d.filter(we=>ae(we)&&!be.has(we.predicate)),Me=ke.map(we=>[we.subject,we.predicate,we.object]),Nt=hs(Me,re,te,xe,{budget:10});for(let we of N){let Ve=Nt.find(Pn=>Pn.subject===we&&O.has(Pn.object));if(!Ve)continue;let ho=ke.find(Pn=>Pn.subject===Ve.subject&&Pn.predicate===Ve.viaProperty&&Pn.object===Ve.viaValue),go=Y.find(Pn=>Pn.subject===Ve.viaValue&&Pn.object===Ve.viaType),Xr=[ho,go].filter(Boolean).map(oe);return{text:`yes \u2014 ${Xr.length?Xr.join("; "):`${Ve.subject} ${Ve.viaProperty} ${Ve.viaValue}, and ${Ve.viaValue} is a ${Ve.viaType}.`}`,replace:!0}}let Fe=xe.length>1?ZS(xe,te,{budget:10}):[];if(Fe.length){let we=B(te.concat(Fe.map(Ce=>[Ce.subject,Ce.object]))),Ve=new Map(xe.map(Ce=>[Ce.restriction,Ce])),ho=new Map;for(let Ce of d)ho.set(`${Ce.subject}\0${Ce.predicate}\0${Ce.object}`,Ce.trust);let go=(Ce,Gn,tn)=>ho.get(`${Ce}\0${Gn}\0${tn}`),Xr=new Map;for(let Ce of Fe){let Gn=Ve.get(Ce.subject),tn=Ve.get(Ce.object),dn=[Gn&&go(Ce.subject,gs,Gn.property),go(Ce.subject,ga,Ce.viaY1),tn&&go(Ce.object,gs,tn.property),go(Ce.object,ga,Ce.viaY2),go(Ce.viaY1,J,Ce.viaY2)].filter(oj=>typeof oj=="number"),ba=Fm(dn,tj);ba!==null&&Xr.set(`${Ce.subject}\0${Ce.object}`,ba)}let Pn=Ce=>{if(Ce.predicate!==J)return Y.find(dn=>dn.subject===Ce.subject&&dn.object===Ce.object);let Gn=Z.find(dn=>dn.subject===Ce.subject&&dn.object===Ce.object);if(Gn)return Gn;let tn=Fe.find(dn=>dn.subject===Ce.subject&&dn.object===Ce.object);return tn?{subject:tn.subject,predicate:J,object:tn.object,provenance:ej,trust:Xr.get(`${tn.subject}\0${tn.object}`)}:void 0};for(let Ce of N){let Gn=z(Ce,O,re,we,{maxHops:3});if(!Gn)continue;let tn=Gn.map(Pn);if(tn.every(Boolean)){let dn=Fm(tn.map(ba=>ba.trust),1);return{text:`yes \u2014 ${Bl(tn)}`,replace:!0,...dn!==null?{trust:dn}:{}}}}}}let nj=ee(c,D),nu=p.filter(K=>nj.has(K.subject)).sort(f),xn=D.trim(),Bs=pn($[2]).trim(),sj=[...N].some(K=>z(K,O,re,je,{maxHops:uM})),su=await KM(e,a,d,xn,N,O,Bs);if(su?.text)return su;let ou=!!su?.budgetExhausted;if(nu.length){let K=nu.slice(0,3).map(oe).join("; "),{ON_PROPERTY_PREDICATE:xe,SOME_VALUES_FROM_PREDICATE:be}=await Promise.resolve().then(()=>(Ot(),an)),ke=new Set,Me=new Set;for(let Ve of d)Ve.predicate===xe?ke.add(Ve.subject):Ve.predicate===be&&Me.add(Ve.subject);let Nt=new Set([...ke].filter(Ve=>Me.has(Ve))),we=nu.some(Ve=>Nt.has(Ve.object))?`The facts to settle it are here, but reaching it means composing a restriction /syllogise doesn't follow. Run "/classify ${xn}", then ask me again.`:sj?`The facts to settle it are here, but the chain is longer than I follow while answering. Run "/syllogise ${xn}", then ask me again.`:`If it's true, teach me: "${xn} is a kind of ${Bs}". If it isn't, teach me: "no ${xn} is a ${Bs}".`;return{text:`I can't confirm that \u2014 nothing I remember says ${xn} is a ${Bs}. I do know: ${K}. ${we}`,replace:!0,miss:!0,...ou?{budgetExhausted:!0}:{}}}let Um=p.filter(K=>N.has(K.object)&&O.has(K.subject)).sort(f)[0];return Um?{text:`I can't confirm that \u2014 what I know runs the other way: ${oe(Um)}. A kind doesn't reverse. If it's true, teach me: "every ${xn} is a ${Bs}". If it isn't, teach me: "no ${xn} is a ${Bs}".`,replace:!0,miss:!0,...ou?{budgetExhausted:!0}:{}}:!Ue&&!F&&!_P(xn)&&!d.some(K=>N.has(K.subject)||N.has(K.object))?{text:`I can't confirm that \u2014 I don't know "${xn}" at all yet. If it's true, teach me: "${xn} is a kind of ${Bs}". If it isn't, teach me: "no ${xn} is a ${Bs}".`,replace:!0,miss:!0,...ou?{budgetExhausted:!0}:{}}:null}let E=l.match(QM);if(E){let[,O,D,N]=E,{SUBCLASS_PREDICATE:F,ON_PROPERTY_PREDICATE:z,buildCardinalityRestrictions:B,proveCardinalityAtLeast:G,CARDINALITY_RULE_CONFIDENCE:J,entailedTrustFrom:ie}=await Promise.resolve().then(()=>(Ot(),an)),de=Xo,ae=p.filter(te=>te.predicate===F&&de(te)).map(te=>[te.subject,te.object]),Z=d.filter(te=>(te.predicate===z||aS.has(te.predicate))&&de(te)),Y=B(Z);if(Y.length){let te=ee(c,O.trim()),re=ee(c,N.trim()),Ae=Number(D),fe=QE(te,re,(Se,Le)=>G(ae,Y,Se,Le,Ae,{}));if(fe){let Se=d.find(pe=>pe.predicate===F&&pe.subject===fe.viaClass&&pe.object===fe.viaRestriction),Le=Se?.provenance?` (source: ${ms(Se.provenance)})`:"",je=fe.kind==="exactly"?"exactly":"at least",Ye=(pe,Xe)=>`${pe}${Xe===1?"":"s"}`,ce=[Se?.trust,...Z.filter(pe=>pe.subject===fe.viaRestriction).map(pe=>pe.trust),...fe.viaClass!==fe.subject?[p.find(pe=>pe.predicate===F&&pe.subject===fe.subject&&pe.object===fe.viaClass)?.trust]:[]].filter(pe=>typeof pe=="number"),le=ie(ce,J);return{text:`yes \u2014 every ${fe.viaClass} has ${je} ${fe.n} ${Ye(fe.object,fe.n)}${Le}, so at least ${Ae} follows.`,replace:!0,...le!==null?{trust:le}:{}}}}}let _=l.match(ZM);if(_){let[,O,D]=_,{SUBCLASS_PREDICATE:N,ON_PROPERTY_PREDICATE:F,buildCardinalityRestrictions:z,proveMaxCardinalityZeroDenial:B,CAX_MAXC0_RULE_CONFIDENCE:G,entailedTrustFrom:J}=await Promise.resolve().then(()=>(Ot(),an)),ie=Xo,de=p.filter(Y=>Y.predicate===N&&ie(Y)).map(Y=>[Y.subject,Y.object]),ae=d.filter(Y=>(Y.predicate===F||aS.has(Y.predicate))&&ie(Y)),Z=z(ae);if(Z.length){let Y=ee(c,O.trim()),te=ee(c,D.trim()),re=QE(Y,te,(Ae,fe)=>B(de,Z,Ae,fe,{}));if(re){let Ae=d.find(je=>je.predicate===N&&je.subject===re.viaClass&&je.object===re.viaRestriction),fe=Ae?.provenance?` (source: ${ms(Ae.provenance)})`:"",Se=[Ae?.trust,...ae.filter(je=>je.subject===re.viaRestriction).map(je=>je.trust),...re.viaClass!==re.subject?[p.find(je=>je.predicate===N&&je.subject===re.subject&&je.object===re.viaClass)?.trust]:[]].filter(je=>typeof je=="number"),Le=J(Se,G);return{text:`no \u2014 every ${re.viaClass} has at most 0 ${re.object}${fe}.`,replace:!0,...Le!==null?{trust:Le}:{}}}}}let v=l.match(eF);if(v){let O=ee(c,v[1]),D=d.filter(N=>N.predicate===gm&&O.has(N.subject)).sort(f);return D.length?m(D):null}let S=u.match(tF);if(S){let[,O,D]=S,N=ee(c,O.trim()),F=ee(c,D.replace(/^an?\s+/i,"").trim()),z=d.filter(B=>B.predicate===gm&&F.has(B.subject)&&N.has(B.object)).sort(f)[0];return z?{text:`yes \u2014 ${oe(z)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${O.trim().toLowerCase()} owns/maintains ${D.trim()}.`,replace:!0}}let C=u.match(nF);if(C){let[,O,D]=C,N=ee(c,O.replace(/^an?\s+/i,"").trim()),F=ee(c,D.trim()),z=d.filter(B=>B.predicate===gm&&N.has(B.subject)&&F.has(B.object)).sort(f)[0];return z?{text:`yes \u2014 ${oe(z)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${O.trim().toLowerCase()} is owned by ${D.trim()}.`,replace:!0}}let x=u.match(sF);if(x){let[,O,D]=x,N=ee(c,O.trim()),F=ee(c,`${D.trim()} method`),z=d.filter(B=>B.predicate===Mr&&N.has(B.subject)&&F.has(B.object)).sort(f)[0];return z?{text:`yes \u2014 ${oe(z)}`,replace:!0}:null}let R=u.match(oF);if(R){let O=ee(c,R[1].trim()),D=d.filter(N=>N.predicate===Mr&&O.has(N.subject)&&/ method$/.test(N.object)).sort(f);return D.length?m(D):null}let w=u.match(cS);if(w){let O=w[1].trim(),D=uS.test(O)||lS.test(O)?null:Ds.test(O)?r||null:O,N=w[2].trim().toLowerCase();if(D){let F=ee(c,D),z=new Map,B=null;if(o){let Y=await ha(o,D);if(B=Y,Y)for(let te of Vl(o,Y.id))for(let re of ee(c,te.label))!F.has(re)&&!z.has(re)&&z.set(re,te.label),F.add(re)}let G=Y=>Y.predicate===Hl&&c(Y.object)===N||Y.predicate===`tmct:${N}`&&Y.object==="true",J=c(D).split(/\s+/).filter(Y=>Y.length>=4&&!jS.has(Y)),ie=Y=>J.some(te=>new Set(String(Y.subject||"").split(/\s+/)).has(te)),de=Y=>F.has(Y.subject)||J.length&&ie(Y),ae=d.filter(Y=>de(Y)&&G(Y)).sort(f)[0];if(ae){let Y=z.get(ae.subject);return{text:Y?`yes \u2014 the code graph says ${B.label} inherits ${Y}, and ${oe(ae)}`:`yes \u2014 ${oe(ae)}`,replace:!0}}let Z=TS(d,F,N,c);if(Z)return{text:`yes \u2014 ${Z.map(oe).join("; ")}`,replace:!0};{let{findIsaChain:Y,SUBCLASS_PREDICATE:te,TYPE_PREDICATE:re}=await Promise.resolve().then(()=>(Ot(),an)),Ae=Xo,fe=d.filter(le=>le.predicate===te&&Ae(le)),Se=d.filter(le=>le.predicate===re&&Ae(le)),Le=fe.map(le=>[le.subject,le.object]),je=Se.map(le=>[le.subject,le.object]),Ye=le=>(le.predicate===te?fe:Se).find(pe=>pe.subject===le.subject&&pe.object===le.object),ce=ee(c,N);for(let le of F){let pe=Y(le,ce,je,Le,{maxHops:2});if(!pe)continue;let Xe=pe.map(Ye);if(Xe.every(Boolean))return{text:`yes \u2014 ${Bl(Xe)}`,replace:!0}}}if(d.some(de)&&!n?.parsed)return/^there\b/i.test(D)||rF.test(N)?null:{text:`I don't have a fact saying ${oM(D)} is ${N}.`,replace:!0};if(!n?.parsed&&!VE.test(N))return dS(D,N)}}let T=Kl(l).match(UP);if(T&&!$m.test(l)){let[,O,D,N]=T,F=D.toLowerCase();if(!ym.test(F)&&!vm.test(F)){let z=O.trim(),B=GP(await ql(F),N),G=B.object.replace(/^an?\s+/i,"").trim();if(z&&G){let J=B.predicate,ie=ee(c,z),de=ee(c,G),ae=[J,kr(J)],Z=d.filter(te=>ae.includes(te.predicate)&&ie.has(te.subject)&&de.has(te.object)).sort(f)[0];if(Z)return{text:`${vw(Z.predicate)?"no":"yes"} \u2014 ${oe(Z)}`,replace:!0,generalVerbQuery:!0};let Y=d.filter(te=>ae.includes(te.predicate)&&ie.has(te.subject));if(Y.length){let te=Y.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${en({subject:z,predicate:J,object:G})}. I do know: ${te}.`,replace:!0,miss:!0}}return null}}}let I=l.match(BP);if(I&&!$m.test(l)){let[,O,D]=I,[N,F]=D.toLowerCase().split(/\s+/);if(!ym.test(N)&&!vm.test(N)){let z=O.trim();if(z){let B=await ql(N);F&&/^mgx:[a-z]+$/.test(B)&&(B=`${B}-${F}`);let G=ee(c,z),J=[B,kr(B)],ie=at(d.filter(de=>J.includes(de.predicate)&&G.has(de.subject)),i);if(ie.length)return{...m(ie),generalVerbQuery:!0}}}}let j=l.match(/^(?:what|who)\s+([a-z]+)\s+(on|in|at|onto|upon|under|over|beside|near|behind|above|below|inside|outside)\s+(.+?)[?.!\s]*$/i);if(j&&!$m.test(l)){let[,O,D,N]=j,F=O.toLowerCase();if(!ym.test(F)&&!vm.test(F)&&!zP.test(F)){let z=await ql(F);/^mgx:[a-z]+$/.test(z)&&(z=`${z}-${D.toLowerCase()}`);let B=ee(c,N.replace(/^(?:an?|the)\s+/i,"").trim()),G=at(d.filter(J=>J.predicate===z&&B.has(J.object)),i);if(G.length)return{...m(G),generalVerbQuery:!0}}}let k=l.match(XM);if(k){let O=ee(c,k[1]),D=at(d.filter(J=>O.has(J.subject)||O.has(J.object)),i);if(!D.length)return null;let N=O.has(D[0].subject)?D[0].subject:D[0].object,F=D.map(J=>` ${oe(J)}`),z=F.slice(0,Re),B=F.slice(Re),G=B.length?`
229
229
  \u2026and ${B.length} more \u2014 say 'more' to see them.`:"";return{text:`${D.length} remembered fact${D.length===1?"":"s"} about ${N}:
230
230
  ${z.join(`
231
- `)}${G}`,replace:!0,...B.length?{pending:{items:B.map(J=>J.trim()),noun:"facts"}}:{}}}let P=n?.parsed?.shape==="meta"?n.parsed.object:null,U=!1,H=null,X=l.match(zM);if(X)H=X[1]?X[1].trim():null,P=X[2],U=!0;else if(!P&&!n?.parsed){let O=l.match(/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i);O&&(P=O[1])}if(!P)return null;let Q=ee(c,P),L=at(p.filter(O=>Q.has(O.subject)),i),V=at(p.filter(O=>Q.has(O.object)),i),W=U?L.length?L:V:V.length?V:L;if(!W.length)return null;if(H&&W===L){let O=ee(c,H),D=F=>p.find(z=>z.subject===F.object&&O.has(z.object)),N=W.map(F=>({hit:F,bridge:D(F)})).find(({bridge:F})=>F);if(N)return{text:`${oe(N.hit)} \u2014 ${oe(N.bridge)}`,replace:!0}}return m(W)}function vm(e){let t=e.sourceTypes||[];return t.length===0||t.some(n=>n!=="corpusWeak")}async function CS(e){let{resolveReasoningConfig:t}=await Promise.resolve().then(()=>(ME(),PE));try{let{loadTomlConfig:n,normalizeConfig:s}=await Promise.resolve().then(()=>(Oi(),hf)),o=await n(e),r=await s(o,{configDir:e});return t(r)}catch{return t(null)}}function cS(e,t,n){for(let s of t){if(e.has(s.subject))return s.subject;if(e.has(s.object))return s.object}return n}var _m,bP,In,Dl,FE,lS,nQ,wP,sQ,DE,yP,oQ,uS,dS,fS,$P,zE,rQ,iQ,aQ,cQ,lQ,Am,uQ,vP,Ke,pm,Gl,Xo,xP,pS,EP,Yo,dQ,fQ,pQ,mQ,hQ,gQ,bQ,wQ,yQ,$Q,vQ,xQ,EQ,SQ,jQ,kQ,RQ,_Q,UE,kP,Yl,RP,TQ,AQ,Im,mS,CQ,IQ,OQ,NQ,_P,LQ,gm,bm,TP,PQ,AP,CP,wm,IP,NP,MQ,hS,gS,LP,FQ,DQ,bS,zQ,UQ,BQ,PP,WQ,MP,Yr,GQ,VQ,HQ,wS,qQ,KQ,FP,YQ,XQ,JQ,QQ,BE,GE,Om,Zt,zP,BP,WP,Bl,KP,vS,ZQ,Sm,xS,YP,XP,Kl,JP,QP,po,On,ZP,eM,tM,km,YE,nM,Re,oM,rM,iM,XE,aM,uM,dM,fM,pM,mM,hM,gM,bM,wM,yM,$M,vM,xM,QE,kS,SM,jM,RM,_M,TM,AM,CM,tS,IM,NM,DM,zM,UM,BM,sS,WM,GM,VM,HM,qM,oS,Ds,KM,rS,iS,aS,YM,JM,QM,e7,AS,eF,tF,t7,xm,Rm,nF,n7,s7,IS,o7,r7,i7,a7,c7,Jl,l7,u7,d7,f7,sF,p7,m7,ea=M(()=>{Je();tv();Kt();De();Jn();sp();qc();Kc();ni();Yc();uv();qe();cc();Qc();lp();Kn();Sn();hr();Ba();ep();tp();fr();cs();Fu();Ur();jv();Tv();Iv();gp();Ov();$p();vp();Wv();Gv();Hv();hl();Zi();Wc();Vr();Ox();Px();Mx();lo();cE();Wa(void 0);Ua(Hc);_m=new Set(["it","this","that","here"]),bP=e=>_m.has(String(e||"").trim().toLowerCase()),In={imports:"understand a dependency/import relationship",uses:"understand a dependency/usage relationship (imports and/or calls)",calls:"understand a call relationship",callsSymbol:"understand a call relationship",defines:"locate what a module/class defines",contains:"understand class membership (methods/attributes)",tests:"assess test coverage",inherits:"understand a class hierarchy/inheritance relationship",touches:"understand commit/change history",touchesSymbol:"understand commit/change history",cochange:"understand change-coupling between modules",reexports:"understand a module's public exports/API surface",serves:"understand which component provides or backs another",denotes:"understand which vocabulary term names a code entity"},Dl=e=>e?`${String(e).toLowerCase()}(s)`:"entities",FE="look up a taught fact about a subject/verb/object";lS={find:{tool:"tmct_search",arg:"query",help:"lexical search across the graph"},search:{tool:"tmct_search",arg:"query",help:"alias of /find"},context:{tool:"tmct_context",arg:"symbol",help:"the sized edit bundle for a symbol (start here to change code)"},snippet:{tool:"tmct_snippet",arg:"symbol",help:"exact source of one function/class/method"},describe:{tool:"tmct_describe",arg:"symbol",help:"a symbol's definition, kind and relations"},signature:{tool:"tmct_signature",arg:"symbol",help:"a symbol's signature only"},members:{tool:"tmct_members",arg:"class",help:"the methods/attributes of a class"},subclasses:{tool:"tmct_subclasses",arg:"class",help:"the subclasses of a class"},impact:{tool:"tmct_impact",arg:"module",help:"what a change to this module or symbol reaches (impact closure)"},callers:{tool:"tmct_callers",arg:"symbol",help:"functions that call this symbol"},callees:{tool:"tmct_callees",arg:"symbol",help:"functions this symbol calls"},tests:{tool:"tmct_tests_for",arg:"symbol",help:"the tests covering this symbol"},untested:{tool:"tmct_untested",arg:null,help:"symbols with no covering test"},history:{tool:"tmct_history",arg:"symbol",help:"the commit history of this symbol"},exports:{tool:"tmct_exports",arg:"module",help:"a module's public exports"},arch:{tool:"tmct_architecture",arg:"package",help:"the architecture overview (optional package filter)",optional:!0}},nQ=new Set(["stats","memory","focus",...Object.keys(lS)]),wP=new Set(["have","has","holds","hold"]),sQ=new RegExp(`\\b(?:${[...Object.keys(me),...Object.keys(Vs)].filter(e=>!wP.has(e)).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})\\b`,"i"),DE=e=>`${e.subject} ${e.predicate} ${e.object} ${e.provenance||""}`,yP=(e,t)=>{let n=DE(e),s=DE(t);return n<s?-1:n>s?1:0},oQ=new Set([...ev.map(e=>e.name),...Object.values(lS).map(e=>e.tool)]),uS=new Set(["hi","hello","hey","yo","hiya","howdy","sup","greetings","g'day","gday","hey there","hi there","hello there","good morning","good afternoon","good evening","morning","alright","you alright","alright mate","morning all","yeah nah","hey y'all","howdy there","hiya there","good day","good day to you","salutations","good to meet you","pleased to meet you","yo yo","ayy","wassup","sup fam","heya","hiya!","gm","ge"]),dS=new Set(["thanks","thank you","thankyou","thx","ty","ta","cheers","nice one","much appreciated","cool thanks","many thanks","much obliged","ta very much","cheers mate","cheers for that","tks","sweet thanks","nice","brilliant","ta for that","cheers, that's everything for now, thanks","that's everything for now, thanks","that's all for now, thanks"]),fS=new Set(["bye","goodbye","quit","exit","see ya","see you","cya","later","farewell","peace","peace out","im off","i'm off","gtg","gotta go","catch you later","farewell then"]),$P=new Set(["ok","okay","cool","aight","fair enough","got it","gotcha","noted","sounds good","sure","cool cool","right","haha ok fair enough"]),zE=e=>e.replace(/(.)\1+/g,"$1");rQ=Tm(uS),iQ=Tm(dS),aQ=Tm(fS),cQ=new RegExp(`^(?:${[...$P].map(ot).join("|")})\\s+(.+)$`,"i"),lQ=[...uS,...dS,...fS,"what can you do","what do you do","help","how do you work","who are you","what are you","what is your name"],Am="(?:[a-z]+er|better|worse|(?:more|less)\\s+[a-z]+)",uQ=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are)\\s+(${Am})\\s+than\\s+(.+)$`,"i"),vP=new RegExp(`^(?:is|are)\\s+(.+?)\\s+(${Am})\\s+than\\s+(.+?)[?.!\\s]*$`,"i"),Ke="on|in|at|onto|upon|under|over|beside|near|behind|above|below|inside|outside",pm="mgx:ownedBy",Gl="mgx:hasProperty",Xo="rdfs:subClassOf",xP="rdf:type",pS="rdfs:subPropertyOf",EP=new Set(["operator","teach","entailed"]),Yo=e=>!!e.sourceTypes?.some(t=>EP.has(t));dQ=new RegExp(`^you\\s+(?:can|may)\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ke})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),fQ=new RegExp(`^an?\\s+([a-z][\\w-]*)\\s+(?:can|may)\\s+be\\s+([a-z]+)\\s+(${Ke})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),pQ=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ke})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*nothing\\s+may\\s+([a-z]+)\\s+(${Ke})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),mQ=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ke})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*the\\s+([a-z][\\w-]*)\\s+must\\s+be\\s+(${Am})\\s+than\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),hQ=new RegExp(`^([a-z]+ing)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ke})\\s+an?\\s+([a-z][\\w-]*)\\s+makes\\s+(?:it|the\\s+([a-z][\\w-]*))\\s+([a-z]+)\\s+(${Ke})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),gQ=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ke})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*the\\s+([a-z][\\w-]*)\\s+may\\s+not\\s+be\\s+with\\s+the\\s+([a-z][\\w-]*)\\s+without\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i");bQ=new RegExp(`^the\\s+goal\\s+is\\s+that\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${Ke})\\s+([\\w-]+)[.!?]*$`,"i"),wQ=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+to\\s+([a-z]+)\\s+(${Ke})\\s+([\\w-]+)[.!?]*$`,"i"),yQ=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+(${Ke})\\s+([\\w-]+)[.!?]*$`,"i"),$Q=new RegExp(`^(?:can|could)\\s+you\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ke})\\s+an?\\s+([a-z][\\w-]*)[?.!]*$`,"i"),vQ=new RegExp(`^(?:get|put|place|stack)\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${Ke})\\s+([\\w-]+)[?.!]*$`,"i"),xQ=new RegExp(`^the\\s+goal\\s+is\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${Ke})\\s+([\\w-]+)[?.!]*$`,"i"),EQ=new RegExp(`^(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${Ke})\\s+([\\w-]+)$`,"i"),SQ=new RegExp(`^(?:and\\s+|so\\s+|but\\s+)?what\\s+if\\s+([\\w-]+)\\s+(?:had\\s+)?(?:started|start|starts|begun|began|begins|was|were|is|had\\s+been|rested|rests|sat|sits|stood|stands|lay|lies|lain)(?:\\s+(?:out|off))?\\s+(?:${Ke})\\s+([\\w-]+)(?:\\s+(?:instead|initially|to\\s+start\\s+with|at\\s+the\\s+start|from\\s+the\\s+start|at\\s+the\\s+beginning))?[?.!\\s]*$`,"i"),jQ=new RegExp(`^(?:and\\s+|so\\s+|but\\s+)?why\\s+(?:did\\s+you\\s+|do\\s+you\\s+|would\\s+you\\s+)?(?:choose\\s+to\\s+|decide\\s+to\\s+)?([a-z]+)\\s+([\\w-]+)(?:\\s+(?:${Ke})\\s+([\\w-]+))?(?:\\s+(?:first|initially|at\\s+the\\s+start|to\\s+start(?:\\s+with)?|to\\s+begin(?:\\s+with)?))?\\s+(?:instead\\s+of|rather\\s+than|and\\s+not|not)\\s+([\\w-]+)[?.!\\s]*$`,"i"),kQ=new RegExp(`^(?:and\\s+|so\\s+|but\\s+)?why\\s+(?:not|didn'?t\\s+you|did\\s+you\\s+not|couldn'?t\\s+you)\\s+([a-z]+)\\s+([\\w-]+)(?:\\s+(?:${Ke})\\s+([\\w-]+))?(?:\\s+(?:first|initially|at\\s+the\\s+start|to\\s+start(?:\\s+with)?))?[?.!\\s]*$`,"i"),RQ=new RegExp(`^(?:what|who)\\s+([a-z']+)\\s+(${Ke})\\s+(.+?)[?.!\\s]*$`,"i"),_Q=new RegExp(`^what\\s+(?:does|do|is)\\s+([\\w-]+)\\s+([a-z]+)(?:\\s+(${Ke}))?[?.!\\s]*$`,"i"),UE=/^(?:anywhere|everywhere|nowhere|somewhere)$/i,kP=new Set(["bus","gas","plus","minus","surplus","lens","bias","atlas","canvas","virus","bonus","campus","census","chorus","circus","focus","status","iris","genius","sinus","walrus","cactus","fungus","radius","nucleus","alias","crocus","abacus","syllabus","octopus","platypus"]);Yl="(?:(?:usually|often|sometimes|rarely|always|typically|generally|occasionally|frequently|normally|regularly|commonly|mostly|currently|still|also|really|actually|closely|strongly|directly)\\s+)?",RP="(?:cannot|can't|can not|does not|doesn't|do not|don't|never)",TQ=new RegExp(`^(.+?)\\s+(${RP})\\s+(.+)$`,"i"),AQ=new RegExp(`^([\\w'-]+)\\s+${Yl}([a-z]+)\\s+(.+?)[.!?]*$`,"i"),Im="connected|related|associated|linked|based|derived|composed|made|used|known|located|found|involved|concerned",mS="with|to|from|by|of|in|on|for|as|about|into",CQ=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are|was|were)\\s+${Yl}(${Im})\\s+(${mS})\\s+(.+)$`,"i"),IQ=new RegExp(`^(the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(is|are|was|were)\\s+(?:an?\\s+)?([\\w'-]+)\\s+(${Im})\\s+(${mS})\\s+(.+)$`,"i"),OQ=new RegExp(`^(?:the\\s+|an?\\s+)([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+([a-z]+)\\s+(${Ke})\\s+(.+?)[.!?]*$`,"i"),NQ=new RegExp(`^(every|each|all)\\s+([\\w'-]+)\\s+([a-z]+)\\s+(${Ke})\\s+(.+?)[.!?]*$`,"i"),_P="(?:just\\s+)?(?:one|another)\\s+more|another",LQ=new RegExp(`^(?:${_P})\\s+([\\w'-]+)\\s+([a-z]+)\\s+(${Ke})\\s+(.+?)[.!?]*$`,"i"),gm=/^(?:is|are|am|owns|maintains)$/i,bm=/\b(?:is|are|am|owns|maintains)\b/i,TP=new RegExp("^(?:i|me|you|he|him|she|her|it|we|us|they|them|my|your|his|its|our|their|mine|yours|hers|ours|theirs|this|that|these|those|a|an|the|every|each|all|some|any|no|both|either|neither|in|on|at|to|from|by|with|for|of|about|into|onto|over|under|near|before|after|during|through|up|down|off|out|above|below|between|among|against|without|within|along|across|behind|beyond|upon|toward|towards|per|and|but|or|if|because|although|though|while|when|since|unless|until|whether|so|nor|than|as|what|who|whom|whose|which|where|why|how)$","i"),PQ=new RegExp(`^(?:${$o.filter(e=>!/\s/.test(e)).join("|")})$`,"i");AP=new RegExp(`^(?:does|did)\\s+(?:(?:every|each|all|any)\\s+)?([\\w'-]+)\\s+${Yl}([a-z]+)\\s+(.+?)[?.!\\s]*$`,"i"),CP=new RegExp(`^what\\s+(?:does|did)\\s+([\\w'-]+)\\s+${Yl}([a-z]+(?:\\s+(?:${Ke}))?)[?.!\\s]*$`,"i"),wm=/^(?:be|own|maintain)$/i,IP=new RegExp(`^(${Ke})\\s+(.+)$`,"i");NP=["first","second","third","then","next","finally","later","meanwhile","afterward","afterwards"],MQ=new RegExp(`^(?:${NP.join("|")})\\b\\s*,?\\s+`,"i"),hS=Object.freeze(["you","i","it","they","he","she","we"]),gS=Object.freeze(["you're","i'm","it's","they're","he's","she's","we're"]),LP=Object.freeze([...gS,...hS]),FQ=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(${LP.join("|")})\\s+\\S+`,"i"),DQ=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(?:(${hS.join("|")})\\s+(?:is|are|am|was|were)|(${gS.join("|")}))\\s+(?:an?\\s+)?[\\w'-]+[.!?]*$`,"i"),bS="forget|unlearn|delete|remove",zQ=new RegExp(`^(?:${bS})\\s+(?:that\\s+)?(?:a\\s+|an\\s+)?([\\w-]+(?:\\s+[\\w-]+)?)\\s+(?:is|are)\\s+(?:an?\\s+)?(?:(?:kind|type)\\s+of\\s+)?([\\w-]+)$`,"i"),UQ=new RegExp(`^([\\w-]+)\\s+([a-z]+)s\\s+(${Ke})\\s+([\\w-]+)$`,"i"),BQ=new RegExp(`^(?:${bS})\\s+(?:that\\s+)?([\\w-]+)\\s+([a-z]+)s\\s+(${Ke})\\s+([\\w-]+)$`,"i"),PP="collection|set|group|family",WQ=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are)\\s+an?\\s+(?:${PP})\\s+of\\s+(?:the\\s+)?([\\w'-]+)[.!?]*$`,"i"),MP=Object.freeze(["mgx:memberOf","mgx:partOf"]),Yr="(?:\\s+(?:exactly|really|actually|truly|anyway|internally|properly))?",GQ=new RegExp(`^what\\s+does\\s+(.+?)${Yr}\\s+do${Yr}\\??$`,"i"),VQ=new RegExp(`^what\\s+(.+?)${Yr}\\s+does${Yr}\\??$`,"i"),HQ=new RegExp(`^what(?:'s|s|\\s+is)\\s+(.+?)${Yr}\\s+do${Yr}\\??$`,"i"),wS="([A-Za-z][\\w'.-]*(?:\\s+[A-Za-z][\\w'.-]*){0,3})",qQ=new RegExp(`^who\\s+(?:is|was)\\s+${wS}$`,"i"),KQ=new RegExp(`^what\\s+(?:did|has)\\s+${wS}\\s+(?:touch(?:ed)?|chang(?:e|ed)|work(?:ed)?\\s+on|commit(?:ted)?)$`,"i"),FP="(?:good|bad|clean|messy|ugly|nice|great|terrible|awful|solid|elegant|readable|maintainable|well[- ]written|well[- ]structured|spaghetti|ok|okay|decent|healthy)",YQ=new RegExp(`^is\\s+(?:this|the)\\s+code(?:base)?\\s+(?:any\\s+)?${FP}\\b`,"i"),XQ=new RegExp("^(?:what\\s+time\\s+is\\s+it(?:\\s+(?:now|right\\s+now))?|what(?:'s|s|\\s+is)\\s+the\\s+time(?:\\s+(?:now|right\\s+now))?|what\\s+day\\s+is\\s+it(?:\\s+today)?|what(?:'s|s|\\s+is)\\s+(?:the\\s+)?(?:day|date)(?:\\s+today)?|what(?:'s|s|\\s+is)\\s+today'?s\\s+date|what(?:'s|s|\\s+is)\\s+the\\s+weather(?:\\s+like)?(?:\\s+(?:today|outside))?|how'?s\\s+the\\s+weather(?:\\s+like)?(?:\\s+(?:today|outside))?)\\??$","i"),JQ=Object.freeze({game:["higher","lower","warmer","colder","hotter","up","down","guess"],spiderFly:["watch","step","tick","move","board","web"],adventure:["help","xyzzy","wait","hint","plugh"]});QQ=new Set([...Object.keys(me).flatMap(e=>e.split(/[\s-]+/)),...fn,...Ln,"owns","maintains"].filter(e=>e.length>=3)),BE=new Set(["mgx:hidden-in","mgx:is-objective","mgx:unlocks-with","mgx:is-npc","mgx:acts-on-turn","mgx:acts-toward","mgx:is-container","mgx:is-open"]);GE=new Set(["owl:onProperty","owl:someValuesFrom","owl:allValuesFrom"]),Om=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:works-in"]);Zt=e=>`${e.subject} ${yS(e.predicate)} ${e.object}`;zP=Object.entries(Fs).filter(([e])=>!Om.has(e)).map(([e,t])=>{let n=/^(?:is|are)\s+(.+)$/i.exec(t);return n?{predicate:e,marker:n[1].trim().toLowerCase()}:null}).filter(e=>e&&e.marker.length>1).sort((e,t)=>t.marker.length-e.marker.length);BP=/ \(source: [^)]*\)$/;WP=8;Bl=null;KP=/^(?:every|each|all|any)\s+/i;vS=new Set(["module","modules","class","classes","function","functions","method","methods","handler","handlers","controller","controllers","service","services","component","components","flow","flows","thing","things","item","items","object","objects","commit","commits"]),ZQ=new Set([["interpreter","compiler"],["string","thread"],["heart","kernel"],["battalion","heap"],["bash","sock"],["command","skill"],["docker","longshoreman"],["name","list"],["list","number"]].map(([e,t])=>[e,t].sort().join("|"))),Sm=/^(?:is|are|was|were)\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)\s+(?:the|an?)\s+([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,xS=/^(?:who|what)\s+(?:is|are)\s+(?:the|an?)\s+([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,YP=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]+(?:\s+[A-Z][\w-]*)?)'s\s+([a-z][\w-]*)[?.!\s]*$/i,XP=/^(who|what)'?s\s+/i,Kl=e=>String(e).replace(XP,(t,n)=>`${n} is `),JP=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]{2,}?)s\s+([a-z][\w-]*)[?.!\s]*$/i;QP=/^list\s+(?:the\s+|all\s+)?([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,po=/^(?:is|are)\s+(?:an?\s+)?(.+?)\s+(?:a\s+kind\s+of|a\s+type\s+of|an?)\s+(.+?)[?.!\s]*$/i,On=new Set(["rdfs:subClassOf","rdf:type"]),ZP=6,eM=/^why\s+(?=(?:is|are)\b)/i,tM=/^explain\s+how\s+you\s+know\s+(?:that\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i;km=new Set(["kind","sort","type","subclass","superclass"]),YE=/^(?:so\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)\s*,?\s*(?:now\s+)?(?:right|correct|yeah)\??$/i,nM=/^(?:what\s+do\s+you\s+know\s+about|what(?:'s|s|\s+is)\s+in\s+your\s+memory\s+about|what\s+do\s+you\s+remember\s+about)\s+(.+?)[?.!\s]*$/i,Re=32;oM=/^(?:can|could)\s+(all\s+|every\s+)?(?:an?\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z]+)[?.!\s]*$/i,rM=/^(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+have\s+(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i,iM=/^how\s+many\s+(.+?)\s+(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+have[?.!\s]*$/i,XE=new Set(["mgx:hasA","tmct:has"]),aM=/^(?:can|could)\s+(?:all\s+|every\s+)?(?:an?\s+|the\s+)?(.+?)\s+be\s+([a-z][\w-]*)[?.!\s]*$/i;uM=/^(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+([a-z]+)\s+(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i,dM=/^what\s+can\s+(?:an?\s+)?(.+?)\s+do[?.!\s]*$/i,fM=/^what\s+has\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,pM=/^what\s+(?:(?:can\s+be|is)\s+used\s+for|is\s+for)\s+(.+?)[?.!\s]*$/i,mM=/^where(?:'s|\s+is|\s+are)\s+(.+?)(?:\s+now)?\s*[?.!]*$/i,hM=/^where\s+(?:does|do|did)\s+(.+?)\s+[a-z][a-z'-]*(?:\s+now)?\s*[?.!]*$/i,gM=new RegExp(`^what(?:'s|\\s+is|\\s+are)\\s+(${Ke})\\s+(.+?)\\s*[?.!]*$`,"i"),bM=/^what(?:'s|\s+is|\s+are)\s+(?:the\s+)?(parts|members|contents)\s+of\s+(?:the\s+|an?\s+)?(.+?)\s*[?.!]*$/i,wM=/^what\s+([a-z][\w-]*)\s+(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+([a-z][a-z-]*)\s*[?.!]*$/i,yM=/^(?:do|does)\s+(all\s+|every\s+)?(?:an?\s+|the\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z-]+)[?.!\s]*$/i,$M=/^what\s+can\s+(?!be\s)(.+?)[?.!\s]*$/i,vM=/^what\s+(?:cannot|can't|cant|can\s+not)\s+(.+?)[?.!\s]*$/i,xM=/^(?:which|what)\s+([\w'-]+(?:\s+[\w'-]+)*?)\s+can\s+(.+?)[?.!\s]*$/i;QE=e=>String(e||"").replace(/\s+/g," ").trim();kS="(?:most|least)\\s+[a-z][\\w-]*|[a-z][\\w-]*est|best|worst",SM=new RegExp(`^which\\s+([\\w'-]+)\\s+(?:is|are)\\s+(?:the\\s+)?(${kS})[?.!\\s]*$`,"i"),jM=new RegExp(`^what(?:'s|s|\\s+is)\\s+the\\s+(${kS})\\s+([\\w'-]+)[?.!\\s]*$`,"i");RM=new Set(["rdfs:subClassOf","rdf:type","mgx:hasA","mgx:capableOf","mgx:usedFor","mgx:ownedBy","owl:disjointWith","mgx:hasProperty","mgx:receivesAction"]),_M=Object.entries(Fs).filter(([e])=>!RM.has(e)&&!Om.has(e)).map(([e,t])=>({predicate:e,re:new RegExp(`^what\\s+${ot(t)}\\s+(.+?)[?.!\\s]*$`,"i")})).sort((e,t)=>t.re.source.length-e.re.source.length),TM=new Set(["rdfs:subClassOf","rdf:type","owl:disjointWith","mgx:hasProperty","mgx:hasA","mgx:capableOf","mgx:ownedBy"]),AM=new Set(["mgx:partOf","mgx:memberOf"]),CM=Object.entries(Fs).filter(([e])=>!TM.has(e)&&!Om.has(e)).map(([e,t])=>{let n;if(t==="can be")n=new RegExp("^can\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+be\\s+(.+?)[?.!\\s]*$","i");else if(t.startsWith("is ")){let s=ot(t.slice(3));n=new RegExp(`^(?:is|are)\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+${s}\\s+(?:an?\\s+|the\\s+)?(.+?)[?.!\\s]*$`,"i")}else{let[s,...o]=t.split(" "),r=[Xl(s),...o].map(ot).join("\\s+");n=new RegExp(`^(?:does|do)\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+${r}\\s+(?:an?\\s+|the\\s+)?(.+?)[?.!\\s]*$`,"i")}return{predicate:e,phrase:t,re:n}}).sort((e,t)=>t.re.source.length-e.re.source.length),tS=/^what\s+(?:inherits?\s+(?:from\s+)?(?:an?\s+)?|is\s+(?:an?\s+)?(?:kind|sort|type)\s+of\s+|is\s+(?:an?\s+)?subclass\s+of\s+)(.+?)[?.!\s]*$/i,IM=new Set(["changed","change","changes","updated","modified","happened","occurred"]);NM=new Set(["owl:unionof","owl:complementof","owl:oneof","owl:allvaluesfrom","owl:mincardinality","owl:maxcardinality","owl:cardinality","rdfs:subpropertyof","owl:inverseof"]);DM=/^what\s+(?:did|have)\s+(?:i|we|you)\s+(?:told|tell|said|say)\s+(?:you|me|us)?\s*about\s+(.+?)[?.!\s]*$/i,zM=/^what\s+(?:kind|type)\s+of\s+(?:an?\s+)?([\w-]+(?:\s+[\w-]+)?)?\s*(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,UM=/^does\s+every\s+(.+?)\s+have\s+at\s+least\s+(\d+)\s+(.+?)[?.!\s]*$/i,BM=/^does\s+an?\s+(.+?)\s+have\s+an?\s+(.+?)[?.!\s]*$/i,sS=new Set(["owl:cardinality","owl:minCardinality","owl:maxCardinality","owl:onClass"]),WM=/^who\s+(?:owns|maintains)\s+(.+?)[?.!\s]*$/i,GM=/^(?:does|did)\s+([\w'-]+)\s+(?:owns?|maintains?)\s+(.+?)[?.!\s]*$/i,VM=/^(?:is|are|was|were)\s+(.+?)\s+owned\s+by\s+([A-Za-z][\w'-]*(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,HM=/^(?:does|did)\s+([\w'-]+)\s+(?:has|have)\s+an?\s+([a-z][\w-]*)\s+method[?.!\s]*$/i,qM=/^what\s+methods\s+does\s+([\w'-]+)\s+have[?.!\s]*$/i,oS=/^(?:is|are|was|were)\s+(.+?)\s+([A-Za-z][\w-]*)[?.!\s]*$/i,Ds=/^(?:it|this|that)$/i,KM=/^(?:it|them|this|that|in|on|of|to|at)$/i,rS=/^(?:it|this|that)(?:\s+one)?\s+(?:before|after)\b/i,iS=/^(?:you|i|they|he|she|we)\b/i,aS=(e,t)=>({text:`I don't know anything about "${e}" yet \u2014 teach me directly, e.g. "remember that ${ql(e)} is ${t}".`,replace:!0}),YM=/^(?:what\s+(?:did|have)\s+(?:i|we)\s+(?:told?|tell|said?|say)\s+(?:you|me|us)?(?:\s+(?:last\s+time|before|earlier|previously|already))?|what\s+facts?\s+do\s+you\s+(?:know|have|remember)|what\s+do\s+you\s+(?:know|remember)|what\s+have\s+you\s+(?:learned|learnt|remembered))[?.!\s]*$/i;JM=/inherit|supertype|subclass|extend|specializ/i,QM=8;e7=new RegExp(`\\b(?:${[..._m].join("|")})\\b`,"i"),AS=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,eF=/^who\s+(?:is|are|was|were)\s+(?:an?\s+|the\s+)?([\w'-]+)[?.!\s]*$/i,tF=/^(?:please\s+|can\s+you\s+|could\s+you\s+)*(?:define|definition\s+of|give\s+me\s+the\s+definition\s+of)\s+(?:the\s+(?:term|word)\s+)?(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i;t7=new RegExp(`^(?:(?:the|a|an)\\s+)?(.+?)\\s+(${Object.keys(Qe).join("|")})$`,"i"),xm="(?:(?:can|could|would)\\s+you\\s+(?:please\\s+)?)?(?:(?:show|give)\\s+(?:me|us)\\s+|describe\\s+|explain\\s+|what(?:'s|s|\\s+is)\\s+)?",Rm="(?:of|for)\\s+(?:this|the)\\s+(?:app|codebase|repo|repository|project|code)",nF=`(?:\\s+${Rm})?`,n7=[new RegExp(`^${xm}the\\s+architecture(?:\\s+(?:overview|map|diagram))?${nF}(?:\\s+here)?\\??$`,"i"),new RegExp(`^${xm}architecture\\s+(?:${Rm}|overview|map|diagram)\\??$`,"i"),new RegExp(`^${xm}(?:(?:an?|the)\\s+)?(?:overview|map|diagram)\\s+${Rm}(?:\\s+here)?\\??$`,"i")],s7={find:"locate a specific named entity",search:"locate a specific named entity",context:"gather the sized edit bundle for a symbol before changing code",snippet:"view a symbol's exact source",describe:"look up a symbol's definition and relations",signature:"view a symbol's signature",members:In.contains,subclasses:In.inherits,impact:"understand what a change to this module would reach (impact closure)",callers:In.calls,callees:In.calls,tests:In.tests,untested:In.tests,history:In.touches,exports:In.reexports,arch:"understand the overall architecture (package/module boundaries)",capabilities:"see what /plan can plan over \u2014 built-in query tools and taught actions",goals:"see the declared goals a trace is recognized against, and where each one came from",syllogise:"materialize the entailed facts that follow from what's remembered about one term",wiki:"toggle the live Wikipedia supplement for questions nothing local can answer",wikipedia:"choose which source the research lane fetches from",wikidata:"choose which source the research lane fetches from",export:"write the memory store to a file, in the standard JSONL shape",ingest:"read a local text file and store every fact the recognizer grounds from it",news:"surface or work the news feed built over this graph"},IS="(?:changed?|modif(?:y|ied)|edits?|edited|touch(?:es|ed)?|updates?|updated|alters?|altered|deletes?|deleted|removes?|removed|drops?|dropped)",o7=new RegExp(`^what\\s+(?:would|will|might|could|does|do)?\\s*(?:breaks?|fails?|happens?|stops?\\s+working|is\\s+affected|are\\s+affected|gets?\\s+affected|be\\s+affected|is\\s+impacted|be\\s+impacted)\\s+if\\s+(?:i|we|you|one|someone)\\s+${IS}\\s+(?:the\\s+)?(.+?)[?.!\\s]*$`,"i"),r7=new RegExp(`^if\\s+(?:i|we|you|one|someone)\\s+${IS}\\s+(?:the\\s+)?(.+?),?\\s+what\\s+(?:would\\s+|will\\s+|might\\s+|could\\s+|does\\s+|do\\s+)?(?:breaks?|fails?|happens?|stops?\\s+working|is\\s+affected|are\\s+affected|gets?\\s+affected|be\\s+affected|would\\s+break|will\\s+break)[?.!\\s]*$`,"i"),i7=new RegExp("^what\\s+(?:is|are|gets?|would\\s+be|will\\s+be)\\s+(?:affected|impacted|broken)\\s+(?:by|when|if)\\s+(?:i\\s+|we\\s+|you\\s+)?(?:chang(?:e|es|ing)|edit(?:s|ing)?|modif(?:y|ies|ying)|touch(?:es|ing)?|updat(?:e|es|ing)|delet(?:e|es|ing)|remov(?:e|es|ing)|a\\s+change\\s+to)\\s+(?:the\\s+)?(.+?)[?.!\\s]*$","i"),a7=new RegExp("^(?:(?:can|could)\\s+(?:i|we|you|one|someone)\\s+safely|is\\s+it\\s+safe\\s+to)\\s+(?:change|edit|modify|touch|update|alter|delete|remove|drop)\\s+(?:the\\s+)?(.+?)[?.!\\s]*$","i"),c7=new RegExp("^(?:what(?:'s|\\s+is)\\s+the\\s+)?(?:blast\\s+radius|impact)\\s+(?:of|for)\\s+(?:chang(?:ing|es)\\s+|editing\\s+|modifying\\s+|touching\\s+|updating\\s+|deleting\\s+|removing\\s+)?(?:the\\s+)?(.+?)[?.!\\s]*$","i"),Jl="as\\s+(?:its|the|an?)?\\s*(?:base\\s+class|parent\\s+class|base|parent)",l7=new RegExp(`^(.+?)\\s+uses?\\s+(?:which\\s+[\\w'-]+|what)\\s+${Jl}\\s*\\??$`,"i"),u7=new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+uses?\\s+${Jl}\\s*\\??$`,"i"),d7=new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+uses?\\s+(.+?)\\s+${Jl}\\s*\\??$`,"i"),f7=new RegExp(`^(.+?)\\s+uses?\\s+(.+?)\\s+${Jl}\\s*[.!]*$`,"i"),sF=Object.freeze([..._m].filter(e=>e!=="here").concat("they")),p7=new RegExp(`^((?:is|are|can|could|does|do)\\s+|what\\s+(?:is|are)\\s+)(${sF.join("|")})\\b(\\s+\\S.*)?$`,"i"),m7=ne(".tmct","memory","corpus-seed.json")});ea();qe();Mn();hl();var Ql={uninformativeClassMaxShare:.35,uninformativeClassMinSubjects:12,entailedDepthPenalty:.2,minoritySensePenalty:.5,minScore:.05,groupSplitThreshold:4,openerConceptCount:2,maxObjectsPerBodySentence:4,maxBodySentences:4,closerRootCount:2,budget:{chatReply:5,researchPanel:10,cliDigest:12,ledgerTerm:8}};var LS=Object.freeze({"rdfs:subClassOf":"isa","rdf:type":"isa","mgx:atLocation":"location","mgx:locatedNear":"location","mgx:partOf":"partOf","mgx:memberOf":"partOf","mgx:capableOf":"capableOf","mgx:usedFor":"usedFor"}),Qo=Object.freeze(["isa","location","partOf","capableOf","usedFor","other"]),Zl=e=>LS[e]||"other",rF=e=>Math.max(0,Math.min(1,e));function OS(e){let t=(e.sourceTypes||[]).map(n=>ws[n]??0);return t.length?Math.max(...t):typeof e.trust=="number"&&e.trust>0?e.trust:ws.entailed}function iF(e){return Array.isArray(e.environments)&&e.environments.length?!0:(e.sourceTypes||[]).includes("entailed")}function NS(e,t){let n=Number(t?.totalSubjects)||0;return n<=0?0:(Number(t?.classSubjectCounts?.[e])||0)/n}function PS(e,t,n={},s={}){let o={...Ql,...s.config||{}},r=Number.isInteger(s.budget)?s.budget:o.budget.chatReply,i=(t||[]).filter(v=>v&&v.object&&v.object!==e),a=[],c=(Number(n?.totalSubjects)||0)>=o.uninformativeClassMinSubjects,l=[];for(let v of i){if(Zl(v.predicate)==="isa"){let S=NS(v.object,n);if(c&&S>o.uninformativeClassMaxShare){a.push({row:v,family:"isa",reason:"uninformative-class",share:S});continue}}l.push(v)}let u=l.filter(v=>Zl(v.predicate)==="isa").map(v=>v.object),d=ml(u,{subClassEdges:n.subClassEdges||[],disjointEdges:n.disjointEdges||[]}),p=new Map,f=new Map;for(let v of d.clusters){let S=0;for(let C of v.objects){f.set(C,v.label);let x=l.find(R=>R.object===C&&Zl(R.predicate)==="isa");S+=x?OS(x):0}p.set(v.label,S)}let m=null,h=-1;for(let[v,S]of[...p].sort((C,x)=>C[0].localeCompare(x[0])))S>h&&(h=S,m=v);let g=[];for(let v of l){let S=Zl(v.predicate),C=OS(v),x={provenance:C};if(iF(v)&&(C-=o.entailedDepthPenalty,x.entailed=!0),S==="isa"){let w=.6+.4*(1-NS(v.object,n));C*=w,x.informativeness=w;let T=f.get(v.object);m&&T&&T!==m&&(C-=o.minoritySensePenalty,x.minoritySense=T)}C=rF(C),g.push({row:v,family:S,score:C,reasons:x})}let b=[];for(let v of g)v.score<o.minScore?a.push({row:v.row,family:v.family,reason:"below-floor",score:v.score}):b.push(v);let y=new Map;for(let v of b)y.has(v.family)||y.set(v.family,[]),y.get(v.family).push(v);for(let v of y.values())v.sort((S,C)=>C.score-S.score||S.row.object.localeCompare(C.row.object));let $=Qo.filter(v=>y.has(v)).concat([...y.keys()].filter(v=>!Qo.includes(v)).sort()),E=[],_=!1;for(;E.length<r&&!_;){_=!0;for(let v of $){let S=y.get(v);if(S&&S.length&&(E.push(S.shift()),_=!1,E.length>=r))break}}for(let v of $)for(let S of y.get(v)||[])a.push({row:S.row,family:S.family,reason:"over-budget",score:S.score});return E.sort((v,S)=>{let C=Qo.indexOf(v.family),x=Qo.indexOf(S.family);return C-x||S.score-v.score||v.row.object.localeCompare(S.row.object)}),{term:e,selected:E,cut:a,senses:{split:d.split,clusters:d.clusters,dominantLabel:m}}}fi();it();var aF=new Set(["isa","location","partOf","capableOf","usedFor"]),cF=new Set(["single","several","chained","group","closer"]),MS=(e,t)=>`${e}:${t}`;function Nm(e){let t=new Map;for(let n of e||[]){if(!n||typeof n.family!="string"||!aF.has(n.family)||typeof n.form!="string"||!cF.has(n.form)||typeof n.template!="string"||!n.template.trim())continue;let s=MS(n.family,n.form);t.has(s)||t.set(s,{family:n.family,form:n.form,templates:[]});let o=t.get(s);o.templates.includes(n.template)||o.templates.push(n.template)}return t}var Zo=e=>`${jo(e)} ${e}`;function lF(e){let t=(e||[]).map(o=>String(o||"").trim()).filter(Boolean);if(!t.length)return"";let n=Zo(t[0]),s=t.slice(1);return s.length?`${n}, and so ${di(s.map(Zo))}`:n}function uF(e,t,n,s){let o=String(e||"").trim(),r=(t||[]).map(c=>String(c||"").trim()).filter(Boolean),i=r[0]||"",a=String(s||"").trim();return{TERM:o,TERM_CAP:gr(o),A_TERM:Zo(o),A_TERM_CAP:gr(Zo(o)),TERMS:Va(o),TERMS_CAP:gr(Va(o)),PRONOUN:"it",PRONOUN_CAP:"It",PARENT:a,A_PARENT:a?Zo(a):"",OBJECT:i,A_OBJECT:i?Zo(i):"",OBJECTS_A:di(r.map(Zo)),OBJECTS_PLURAL:di(r.map(Va)),OBJECTS_RAW:di(r),CHAIN:lF(n&&n.length?n:r.slice(0,1))}}function dF(e,t){return String(e).replace(/\{([A-Z_]+)\}/g,(n,s)=>s in t?t[s]:"").replace(/\s+/g," ").replace(/\s+([.,;])/g,"$1").trim()}function zs(e,t,n,s={}){let o=(n||[]).filter(Boolean);if(!o.length)return null;let r=s.term??o[0].subject??"",i=s.form||(o.length>1?"several":"single"),a=e instanceof Map?e.get(MS(t,i)):null,c=a?a.templates:null;if(!c||!c.length)return null;let l=s.variantSeed??"",u=sc(`${r}|${t}|${i}|${l}`)%c.length,d=s.objectsOverride||o.map(f=>f.object),p=dF(c[u],uF(r,d,s.chain,s.parent));return p?{text:p,rows:o,family:t,form:i}:null}fi();var fF=Qo.filter(e=>e!=="isa"&&e!=="other");function pF(e){let t=new Map;for(let n of e||[])t.has(n.family)||t.set(n.family,[]),t.get(n.family).push(n.row);return t}function FS(e,t){let n=Math.max(1,Math.trunc(t)||1),s=[];for(let o=0;o<(e||[]).length;o+=n)s.push(e.slice(o,o+n));return s}function mF(e,t){let n=c=>(t?.[c.object]||[])[1]||null,s=new Map;for(let c of e||[]){let l=n(c);l&&s.set(l,(s.get(l)||0)+1)}let o=new Map,r=[],i=[];for(let c of e||[]){let l=n(c);l&&s.get(l)>=2?(o.has(l)||(o.set(l,[]),r.push(l)),o.get(l).push(c)):i.push(c)}let a=r.map(c=>({parent:c,rows:o.get(c)}));return i.length&&a.push({parent:null,rows:i}),a}function hF(e,t,n){let s=new Map,o=new Map;for(let c of t||[]){let l=e?.[c.object];if(!Array.isArray(l)||l.length<2)continue;let u=l[l.length-1];!u||u===c.object||(s.set(u,(s.get(u)||0)+1),o.has(u)||o.set(u,[]),o.get(u).push(c))}let r=[...s.keys()].sort((c,l)=>s.get(l)-s.get(c)||c.localeCompare(l)).slice(0,Math.max(0,n)),i=[],a=new Set;for(let c of r)for(let l of o.get(c)||[])a.has(l.id)||(a.add(l.id),i.push(l));return{roots:r,rows:i}}function gF(e,t,n,s,o){let r=[];if(!e.length)return r;if(e.length===1){let p=t[e[0].object],f=p&&p.length>1?"chained":"single",m=zs(s,"isa",e,{term:n,form:f,chain:p});return m&&r.push({...m,role:"names-term",paragraph:"definition"}),r}if(e.length<=o.groupSplitThreshold){let p=zs(s,"isa",e,{term:n,form:"several"});return p&&r.push({...p,role:"names-term",paragraph:"definition"}),r}let i=e.slice(0,o.openerConceptCount),a=e.slice(o.openerConceptCount),c=zs(s,"isa",i,{term:n,form:i.length>1?"several":"single",variantSeed:n});c&&r.push({...c,role:"names-term",paragraph:"definition"});let l=[];for(let p of mF(a,t))for(let f of FS(p.rows,o.maxObjectsPerBodySentence))l.push({parent:p.parent,rows:f});if(l.length>o.maxBodySentences){let p=l.slice(0,o.maxBodySentences),f=p[p.length-1];for(let m of l.slice(o.maxBodySentences))f.rows=f.rows.concat(m.rows);f.parent=null,l=p}for(let p of l){let f=p.parent?zs(s,"isa",p.rows,{term:n,form:"group",parent:p.parent,variantSeed:p.parent}):zs(s,"isa",p.rows,{term:n,form:"several",variantSeed:n});f&&r.push({...f,role:"describes-isa",paragraph:"definition"})}let{roots:u,rows:d}=hF(t,e,o.closerRootCount);if(u.length){let p=zs(s,"isa",d.length?d:e,{term:n,form:"closer",objectsOverride:u,variantSeed:n});p&&r.push({...p,role:"closes-isa",paragraph:"definition"})}return r}function bF(e,t){if(!e.length)return;let n=e[0];if(/\bnames-term\b/.test(n.role))return;let s=gr(`${jo(t)} ${t}`);n.text=n.text.replace(/^It\b/,s),n.role="names-term"}function wF(e,t){let n=[],s=null,o=null;for(let r of e)(!s||r.paragraph!==o||s.length>=t)&&(s=[],o=r.paragraph,n.push(s)),s.push(r);return n.map(r=>({sentences:r,text:r.map(i=>i.text).join(" ")}))}function DS(e,t,n={}){let s=e?.term||"",o=Number.isInteger(n.maxSentencesPerParagraph)?n.maxSentencesPerParagraph:3,r=n.chains||{},i={...Ql,...n.config||{}},a=pF(e?.selected||[]),c=[];for(let u of gF(a.get("isa")||[],r,s,t,i))c.push(u);for(let u of fF){let d=a.get(u);if(!(!d||!d.length))for(let p of FS(d,i.maxObjectsPerBodySentence)){let f=zs(t,u,p,{term:s});f&&c.push({...f,role:"describes",paragraph:"description"})}}bF(c,s);let l=new Map;for(let u of c)for(let d of u.rows)l.has(d.id)||l.set(d.id,d);return{term:s,sentences:c,paragraphs:wF(c,o),provenanceRows:[...l.values()]}}var yF=e=>({subject:e.subject,predicate:e.predicate,object:e.object,sourceTypes:e.sourceTypes||[],provenance:e.provenance||""});function $F(e){let t=new Set,n=[];for(let s of e||[]){let o=s.provenance||(s.sourceTypes||[]).join(",");!o||t.has(o)||(t.add(o),n.push({provenance:s.provenance||"",sourceTypes:s.sourceTypes||[]}))}return n}var vF=Object.freeze({facts:"show the facts",chains:"show the chains"});function xF(e,t){let n=[...(e?.selected||[]).map(o=>o.row),...(e?.cut||[]).map(o=>o.row)].filter(Boolean),s=Object.entries(t||{}).filter(([,o])=>Array.isArray(o)&&o.length>1).map(([o,r])=>({object:o,chain:r}));return{escapes:vF,facts:n.map(yF),factCount:n.length,chains:s}}function zS(e,t,n={}){let s=t?.term||e?.term||"";return{kind:"term-article",term:s,headline:s,paragraphs:(t?.paragraphs||[]).map(o=>o.text).filter(Boolean),body:t?.paragraphs||[],sources:$F(t?.provenanceRows||[]),detail:xF(e,n.chains),provenanceRows:t?.provenanceRows||[]}}function US(e,t,n={},s=new Map,o={}){let r=PS(e,t,n,o),i=DS(r,s,o);return zS(r,i,o)}hl();Zi();var BS=new Set(["rdfs:subClassOf","rdf:type"]);function WS(e){let t=new Map,n=new Set,s=[],o=[];for(let i of e||[])!i||!i.predicate||(BS.has(i.predicate)?(n.add(i.subject),t.has(i.object)||t.set(i.object,new Set),t.get(i.object).add(i.subject),s.push([i.subject,i.object])):i.predicate==="owl:disjointWith"&&o.push([i.subject,i.object]));let r={};for(let[i,a]of t)r[i]=a.size;return{classSubjectCounts:r,totalSubjects:n.size,subClassEdges:s,disjointEdges:o}}function GS(e,t,n=6){let s=ta(e||[]),o={};for(let r of t||[]){if(r in o)continue;let i=pl(r,s,{cap:n,stopAt:dl});i.length>1&&(o[r]=i)}return o}function VS(e){let t=[],n=new Set;for(let s of e||[])!s||!BS.has(s.predicate)||n.has(s.object)||(n.add(s.object),t.push(s.object));return t}qe();ea();function EF(e,t,n,s,o={}){let r=Nm(s||[]);if(!r||r.size===0)return null;let i=t||[],a=WS(n||i),c=GS(a.subClassEdges,VS(i));return US(e,i,a,r,{...o,chains:c})}function HS(e,t,n,s={}){let o=bt(e||{individuals:[],objectProperties:[]}),r=ee(q,t),i=o.filter(c=>r.has(c.subject));if(!i.length)return null;let a=EF(t,i,o,n,s);return SF(a)}function SF(e){if(!e||!Array.isArray(e.paragraphs)||!e.paragraphs.length)return null;let t=e.detail&&Array.isArray(e.detail.facts)?e.detail.facts:[];return{term:e.term||"",paragraphs:e.paragraphs.slice(),sources:[...new Set((e.sources||[]).map(n=>n.provenance).filter(Boolean))],facts:t,factCount:e.detail&&Number.isInteger(e.detail.factCount)?e.detail.factCount:t.length}}var jF="no session is open on this page yet \u2014 await tmct.open() first",qS=Symbol.for("tmct.surface.fallback");function KS({open:e,ask:t=null,plan:n=null,turn:s=null,page:o={},fallback:r=!1,target:i=globalThis}={}){if(typeof e!="function")throw new Error("publishTmctSurface: `open` must be this page's session factory");let a=i.tmct;if(r&&a&&!a[qS])return a;let c=null,l=()=>{if(!c)throw new Error(jF);return c},u={async open(...d){return c=await e(...d),c},get session(){return c},async turn(d,p){let f=l();return s?s(d,p,f):typeof f.turn!="function"?{answer:"this page runs no conversational turn \u2014 see tmct.session for what it does run",end:!1,record:null,plan:null,research:null}:f.turn(d,p)},async ask(d,p){return t?t(d,p,l()):{answer:"this page has no separate ask route \u2014 it answers questions through tmct.turn()",data:void 0,miss:!0}},async plan(d,p){return n?n(d,p,l()):{refused:!0,why:"this page's bundle carries no capability planner",driver:null,calls:[],composed:null,observed:null}},page:o,fallback:r};return u[qS]=r,i.tmct=u,u}function kF({payload:e=null}={}){let t=Fi();return e&&(t.payload=e),{memoryDir:t}}async function RF(e,t,n){let s=null;try{s=await RS(n.memoryDir,e,null,!0,{})}catch{s=null}if(!(s&&s.text))try{s=await TS(n.memoryDir,e,null,!0,null)}catch{s=null}return s&&s.text?{answer:s.text,data:s,miss:!1}:{answer:null,data:null,miss:!0}}KS({open:kF,ask:RF,page:{normFactTerm:q,digestTermFromPayloadBrowser:HS},fallback:!0});})();
231
+ `)}${G}`,replace:!0,...B.length?{pending:{items:B.map(J=>J.trim()),noun:"facts"}}:{}}}let P=n?.parsed?.shape==="meta"?n.parsed.object:null,U=!1,H=null,X=l.match(JM);if(X)H=X[1]?X[1].trim():null,P=X[2],U=!0;else if(!P&&!n?.parsed){let O=l.match(/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i);O&&(P=O[1])}if(!P)return null;let Q=ee(c,P),L=at(p.filter(O=>Q.has(O.subject)),i),V=at(p.filter(O=>Q.has(O.object)),i),W=U?L.length?L:V:V.length?V:L;if(!W.length)return null;if(H&&W===L){let O=ee(c,H),D=F=>p.find(z=>z.subject===F.object&&O.has(z.object)),N=W.map(F=>({hit:F,bridge:D(F)})).find(({bridge:F})=>F);if(N)return{text:`${oe(N.hit)} \u2014 ${oe(N.bridge)}`,replace:!0}}return m(W)}function Sm(e){let t=e.sourceTypes||[];return t.length===0||t.some(n=>n!=="corpusWeak")}async function LS(e){let{resolveReasoningConfig:t}=await Promise.resolve().then(()=>(UE(),zE));try{let{loadTomlConfig:n,normalizeConfig:s}=await Promise.resolve().then(()=>(Pi(),wf)),o=await n(e),r=await s(o,{configDir:e});return t(r)}catch{return t(null)}}function fS(e,t,n){for(let s of t){if(e.has(s.subject))return s.subject;if(e.has(s.object))return s.object}return n}var Cm,_P,Nn,Ul,BE,pS,pQ,TP,mQ,WE,AP,hQ,mS,hS,gS,CP,GE,gQ,bQ,wQ,yQ,$Q,Om,vQ,IP,Ke,gm,Hl,Jo,OP,bS,NP,Xo,xQ,EQ,SQ,jQ,kQ,RQ,_Q,TQ,AQ,CQ,IQ,OQ,NQ,LQ,PQ,MQ,FQ,DQ,VE,MP,Jl,FP,zQ,UQ,Lm,wS,BQ,WQ,GQ,VQ,DP,HQ,ym,$m,zP,qQ,UP,BP,vm,WP,VP,KQ,yS,$S,HP,YQ,XQ,vS,JQ,QQ,ZQ,qP,e7,KP,Yr,t7,n7,s7,xS,o7,r7,YP,i7,a7,c7,l7,HE,KE,Pm,en,JP,ZP,eM,Gl,rM,jS,u7,Rm,kS,iM,aM,Xl,cM,lM,mo,Ln,uM,dM,fM,Tm,ZE,pM,Re,hM,gM,bM,eS,wM,vM,xM,EM,SM,jM,kM,RM,_M,TM,AM,CM,IM,OM,nS,AS,LM,PM,FM,DM,zM,UM,BM,rS,WM,VM,XM,JM,QM,ZM,aS,eF,tF,nF,sF,oF,cS,Ds,rF,lS,uS,dS,iF,cF,lF,d7,NS,dF,fF,f7,jm,Am,pF,p7,m7,PS,h7,g7,b7,w7,y7,Zl,$7,v7,x7,E7,mF,S7,j7,sa=M(()=>{Je();rv();Kt();De();Jn();ip();Yc();Xc();ni();Jc();mv();qe();uc();el();fp();Kn();kn();gr();Ga();sp();op();pr();cs();Bu();Ur();Tv();Ov();Pv();yp();Mv();Ep();Sp();qv();Kv();Xv();bl();na();Vc();Vr();Mx();zx();Ux();uo();fE();Va(void 0);Wa(Kc);Cm=new Set(["it","this","that","here"]),_P=e=>Cm.has(String(e||"").trim().toLowerCase()),Nn={imports:"understand a dependency/import relationship",uses:"understand a dependency/usage relationship (imports and/or calls)",calls:"understand a call relationship",callsSymbol:"understand a call relationship",defines:"locate what a module/class defines",contains:"understand class membership (methods/attributes)",tests:"assess test coverage",inherits:"understand a class hierarchy/inheritance relationship",touches:"understand commit/change history",touchesSymbol:"understand commit/change history",cochange:"understand change-coupling between modules",reexports:"understand a module's public exports/API surface",serves:"understand which component provides or backs another",denotes:"understand which vocabulary term names a code entity"},Ul=e=>e?`${String(e).toLowerCase()}(s)`:"entities",BE="look up a taught fact about a subject/verb/object";pS={find:{tool:"tmct_search",arg:"query",help:"lexical search across the graph"},search:{tool:"tmct_search",arg:"query",help:"alias of /find"},context:{tool:"tmct_context",arg:"symbol",help:"the sized edit bundle for a symbol (start here to change code)"},snippet:{tool:"tmct_snippet",arg:"symbol",help:"exact source of one function/class/method"},describe:{tool:"tmct_describe",arg:"symbol",help:"a symbol's definition, kind and relations"},signature:{tool:"tmct_signature",arg:"symbol",help:"a symbol's signature only"},members:{tool:"tmct_members",arg:"class",help:"the methods/attributes of a class"},subclasses:{tool:"tmct_subclasses",arg:"class",help:"the subclasses of a class"},impact:{tool:"tmct_impact",arg:"module",help:"what a change to this module or symbol reaches (impact closure)"},callers:{tool:"tmct_callers",arg:"symbol",help:"functions that call this symbol"},callees:{tool:"tmct_callees",arg:"symbol",help:"functions this symbol calls"},tests:{tool:"tmct_tests_for",arg:"symbol",help:"the tests covering this symbol"},untested:{tool:"tmct_untested",arg:null,help:"symbols with no covering test"},history:{tool:"tmct_history",arg:"symbol",help:"the commit history of this symbol"},exports:{tool:"tmct_exports",arg:"module",help:"a module's public exports"},arch:{tool:"tmct_architecture",arg:"package",help:"the architecture overview (optional package filter)",optional:!0}},pQ=new Set(["stats","memory","focus",...Object.keys(pS)]),TP=new Set(["have","has","holds","hold"]),mQ=new RegExp(`\\b(?:${[...Object.keys(me),...Object.keys(Vs)].filter(e=>!TP.has(e)).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})\\b`,"i"),WE=e=>`${e.subject} ${e.predicate} ${e.object} ${e.provenance||""}`,AP=(e,t)=>{let n=WE(e),s=WE(t);return n<s?-1:n>s?1:0},hQ=new Set([...ov.map(e=>e.name),...Object.values(pS).map(e=>e.tool)]),mS=new Set(["hi","hello","hey","yo","hiya","howdy","sup","greetings","g'day","gday","hey there","hi there","hello there","good morning","good afternoon","good evening","morning","alright","you alright","alright mate","morning all","yeah nah","hey y'all","howdy there","hiya there","good day","good day to you","salutations","good to meet you","pleased to meet you","yo yo","ayy","wassup","sup fam","heya","hiya!","gm","ge"]),hS=new Set(["thanks","thank you","thankyou","thx","ty","ta","cheers","nice one","much appreciated","cool thanks","many thanks","much obliged","ta very much","cheers mate","cheers for that","tks","sweet thanks","nice","brilliant","ta for that","cheers, that's everything for now, thanks","that's everything for now, thanks","that's all for now, thanks"]),gS=new Set(["bye","goodbye","quit","exit","see ya","see you","cya","later","farewell","peace","peace out","im off","i'm off","gtg","gotta go","catch you later","farewell then"]),CP=new Set(["ok","okay","cool","aight","fair enough","got it","gotcha","noted","sounds good","sure","cool cool","right","haha ok fair enough"]),GE=e=>e.replace(/(.)\1+/g,"$1");gQ=Im(mS),bQ=Im(hS),wQ=Im(gS),yQ=new RegExp(`^(?:${[...CP].map(ot).join("|")})\\s+(.+)$`,"i"),$Q=[...mS,...hS,...gS,"what can you do","what do you do","help","how do you work","who are you","what are you","what is your name"],Om="(?:[a-z]+er|better|worse|(?:more|less)\\s+[a-z]+)",vQ=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are)\\s+(${Om})\\s+than\\s+(.+)$`,"i"),IP=new RegExp(`^(?:is|are)\\s+(.+?)\\s+(${Om})\\s+than\\s+(.+?)[?.!\\s]*$`,"i"),Ke="on|in|at|onto|upon|under|over|beside|near|behind|above|below|inside|outside",gm="mgx:ownedBy",Hl="mgx:hasProperty",Jo="rdfs:subClassOf",OP="rdf:type",bS="rdfs:subPropertyOf",NP=new Set(["operator","teach","entailed"]),Xo=e=>!!e.sourceTypes?.some(t=>NP.has(t));xQ=new RegExp(`^you\\s+(?:can|may)\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ke})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),EQ=new RegExp(`^an?\\s+([a-z][\\w-]*)\\s+(?:can|may)\\s+be\\s+([a-z]+)\\s+(${Ke})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),SQ=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ke})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*nothing\\s+may\\s+([a-z]+)\\s+(${Ke})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),jQ=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ke})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*the\\s+([a-z][\\w-]*)\\s+must\\s+be\\s+(${Om})\\s+than\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),kQ=new RegExp(`^([a-z]+ing)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ke})\\s+an?\\s+([a-z][\\w-]*)\\s+makes\\s+(?:it|the\\s+([a-z][\\w-]*))\\s+([a-z]+)\\s+(${Ke})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),RQ=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ke})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*the\\s+([a-z][\\w-]*)\\s+may\\s+not\\s+be\\s+with\\s+the\\s+([a-z][\\w-]*)\\s+without\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i");_Q=new RegExp(`^the\\s+goal\\s+is\\s+that\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${Ke})\\s+([\\w-]+)[.!?]*$`,"i"),TQ=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+to\\s+([a-z]+)\\s+(${Ke})\\s+([\\w-]+)[.!?]*$`,"i"),AQ=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+(${Ke})\\s+([\\w-]+)[.!?]*$`,"i"),CQ=new RegExp(`^(?:can|could)\\s+you\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ke})\\s+an?\\s+([a-z][\\w-]*)[?.!]*$`,"i"),IQ=new RegExp(`^(?:get|put|place|stack)\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${Ke})\\s+([\\w-]+)[?.!]*$`,"i"),OQ=new RegExp(`^the\\s+goal\\s+is\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${Ke})\\s+([\\w-]+)[?.!]*$`,"i"),NQ=new RegExp(`^(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${Ke})\\s+([\\w-]+)$`,"i"),LQ=new RegExp(`^(?:and\\s+|so\\s+|but\\s+)?what\\s+if\\s+([\\w-]+)\\s+(?:had\\s+)?(?:started|start|starts|begun|began|begins|was|were|is|had\\s+been|rested|rests|sat|sits|stood|stands|lay|lies|lain)(?:\\s+(?:out|off))?\\s+(?:${Ke})\\s+([\\w-]+)(?:\\s+(?:instead|initially|to\\s+start\\s+with|at\\s+the\\s+start|from\\s+the\\s+start|at\\s+the\\s+beginning))?[?.!\\s]*$`,"i"),PQ=new RegExp(`^(?:and\\s+|so\\s+|but\\s+)?why\\s+(?:did\\s+you\\s+|do\\s+you\\s+|would\\s+you\\s+)?(?:choose\\s+to\\s+|decide\\s+to\\s+)?([a-z]+)\\s+([\\w-]+)(?:\\s+(?:${Ke})\\s+([\\w-]+))?(?:\\s+(?:first|initially|at\\s+the\\s+start|to\\s+start(?:\\s+with)?|to\\s+begin(?:\\s+with)?))?\\s+(?:instead\\s+of|rather\\s+than|and\\s+not|not)\\s+([\\w-]+)[?.!\\s]*$`,"i"),MQ=new RegExp(`^(?:and\\s+|so\\s+|but\\s+)?why\\s+(?:not|didn'?t\\s+you|did\\s+you\\s+not|couldn'?t\\s+you)\\s+([a-z]+)\\s+([\\w-]+)(?:\\s+(?:${Ke})\\s+([\\w-]+))?(?:\\s+(?:first|initially|at\\s+the\\s+start|to\\s+start(?:\\s+with)?))?[?.!\\s]*$`,"i"),FQ=new RegExp(`^(?:what|who)\\s+([a-z']+)\\s+(${Ke})\\s+(.+?)[?.!\\s]*$`,"i"),DQ=new RegExp(`^what\\s+(?:does|do|is)\\s+([\\w-]+)\\s+([a-z]+)(?:\\s+(${Ke}))?[?.!\\s]*$`,"i"),VE=/^(?:anywhere|everywhere|nowhere|somewhere)$/i,MP=new Set(["bus","gas","plus","minus","surplus","lens","bias","atlas","canvas","virus","bonus","campus","census","chorus","circus","focus","status","iris","genius","sinus","walrus","cactus","fungus","radius","nucleus","alias","crocus","abacus","syllabus","octopus","platypus"]);Jl="(?:(?:usually|often|sometimes|rarely|always|typically|generally|occasionally|frequently|normally|regularly|commonly|mostly|currently|still|also|really|actually|closely|strongly|directly)\\s+)?",FP="(?:cannot|can't|can not|does not|doesn't|do not|don't|never)",zQ=new RegExp(`^(.+?)\\s+(${FP})\\s+(.+)$`,"i"),UQ=new RegExp(`^([\\w'-]+)\\s+${Jl}([a-z]+)\\s+(.+?)[.!?]*$`,"i"),Lm="connected|related|associated|linked|based|derived|composed|made|used|known|located|found|involved|concerned",wS="with|to|from|by|of|in|on|for|as|about|into",BQ=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are|was|were)\\s+${Jl}(${Lm})\\s+(${wS})\\s+(.+)$`,"i"),WQ=new RegExp(`^(the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(is|are|was|were)\\s+(?:an?\\s+)?([\\w'-]+)\\s+(${Lm})\\s+(${wS})\\s+(.+)$`,"i"),GQ=new RegExp(`^(?:the\\s+|an?\\s+)([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+([a-z]+)\\s+(${Ke})\\s+(.+?)[.!?]*$`,"i"),VQ=new RegExp(`^(every|each|all)\\s+([\\w'-]+)\\s+([a-z]+)\\s+(${Ke})\\s+(.+?)[.!?]*$`,"i"),DP="(?:just\\s+)?(?:one|another)\\s+more|another",HQ=new RegExp(`^(?:${DP})\\s+([\\w'-]+)\\s+([a-z]+)\\s+(${Ke})\\s+(.+?)[.!?]*$`,"i"),ym=/^(?:is|are|am|owns|maintains)$/i,$m=/\b(?:is|are|am|owns|maintains)\b/i,zP=new RegExp("^(?:i|me|you|he|him|she|her|it|we|us|they|them|my|your|his|its|our|their|mine|yours|hers|ours|theirs|this|that|these|those|a|an|the|every|each|all|some|any|no|both|either|neither|in|on|at|to|from|by|with|for|of|about|into|onto|over|under|near|before|after|during|through|up|down|off|out|above|below|between|among|against|without|within|along|across|behind|beyond|upon|toward|towards|per|and|but|or|if|because|although|though|while|when|since|unless|until|whether|so|nor|than|as|what|who|whom|whose|which|where|why|how)$","i"),qQ=new RegExp(`^(?:${vo.filter(e=>!/\s/.test(e)).join("|")})$`,"i");UP=new RegExp(`^(?:does|did)\\s+(?:(?:every|each|all|any)\\s+)?([\\w'-]+)\\s+${Jl}([a-z]+)\\s+(.+?)[?.!\\s]*$`,"i"),BP=new RegExp(`^what\\s+(?:does|did)\\s+([\\w'-]+)\\s+${Jl}([a-z]+(?:\\s+(?:${Ke}))?)[?.!\\s]*$`,"i"),vm=/^(?:be|own|maintain)$/i,WP=new RegExp(`^(${Ke})\\s+(.+)$`,"i");VP=["first","second","third","then","next","finally","later","meanwhile","afterward","afterwards"],KQ=new RegExp(`^(?:${VP.join("|")})\\b\\s*,?\\s+`,"i"),yS=Object.freeze(["you","i","it","they","he","she","we"]),$S=Object.freeze(["you're","i'm","it's","they're","he's","she's","we're"]),HP=Object.freeze([...$S,...yS]),YQ=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(${HP.join("|")})\\s+\\S+`,"i"),XQ=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(?:(${yS.join("|")})\\s+(?:is|are|am|was|were)|(${$S.join("|")}))\\s+(?:an?\\s+)?[\\w'-]+[.!?]*$`,"i"),vS="forget|unlearn|delete|remove",JQ=new RegExp(`^(?:${vS})\\s+(?:that\\s+)?(?:a\\s+|an\\s+)?([\\w-]+(?:\\s+[\\w-]+)?)\\s+(?:is|are)\\s+(?:an?\\s+)?(?:(?:kind|type)\\s+of\\s+)?([\\w-]+)$`,"i"),QQ=new RegExp(`^([\\w-]+)\\s+([a-z]+)s\\s+(${Ke})\\s+([\\w-]+)$`,"i"),ZQ=new RegExp(`^(?:${vS})\\s+(?:that\\s+)?([\\w-]+)\\s+([a-z]+)s\\s+(${Ke})\\s+([\\w-]+)$`,"i"),qP="collection|set|group|family",e7=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are)\\s+an?\\s+(?:${qP})\\s+of\\s+(?:the\\s+)?([\\w'-]+)[.!?]*$`,"i"),KP=Object.freeze(["mgx:memberOf","mgx:partOf"]),Yr="(?:\\s+(?:exactly|really|actually|truly|anyway|internally|properly))?",t7=new RegExp(`^what\\s+does\\s+(.+?)${Yr}\\s+do${Yr}\\??$`,"i"),n7=new RegExp(`^what\\s+(.+?)${Yr}\\s+does${Yr}\\??$`,"i"),s7=new RegExp(`^what(?:'s|s|\\s+is)\\s+(.+?)${Yr}\\s+do${Yr}\\??$`,"i"),xS="([A-Za-z][\\w'.-]*(?:\\s+[A-Za-z][\\w'.-]*){0,3})",o7=new RegExp(`^who\\s+(?:is|was)\\s+${xS}$`,"i"),r7=new RegExp(`^what\\s+(?:did|has)\\s+${xS}\\s+(?:touch(?:ed)?|chang(?:e|ed)|work(?:ed)?\\s+on|commit(?:ted)?)$`,"i"),YP="(?:good|bad|clean|messy|ugly|nice|great|terrible|awful|solid|elegant|readable|maintainable|well[- ]written|well[- ]structured|spaghetti|ok|okay|decent|healthy)",i7=new RegExp(`^is\\s+(?:this|the)\\s+code(?:base)?\\s+(?:any\\s+)?${YP}\\b`,"i"),a7=new RegExp("^(?:what\\s+time\\s+is\\s+it(?:\\s+(?:now|right\\s+now))?|what(?:'s|s|\\s+is)\\s+the\\s+time(?:\\s+(?:now|right\\s+now))?|what\\s+day\\s+is\\s+it(?:\\s+today)?|what(?:'s|s|\\s+is)\\s+(?:the\\s+)?(?:day|date)(?:\\s+today)?|what(?:'s|s|\\s+is)\\s+today'?s\\s+date|what(?:'s|s|\\s+is)\\s+the\\s+weather(?:\\s+like)?(?:\\s+(?:today|outside))?|how'?s\\s+the\\s+weather(?:\\s+like)?(?:\\s+(?:today|outside))?)\\??$","i"),c7=Object.freeze({game:["higher","lower","warmer","colder","hotter","up","down","guess"],spiderFly:["watch","step","tick","move","board","web"],adventure:["help","xyzzy","wait","hint","plugh"]});l7=new Set([...Object.keys(me).flatMap(e=>e.split(/[\s-]+/)),...fn,...Mn,"owns","maintains"].filter(e=>e.length>=3)),HE=new Set(["mgx:hidden-in","mgx:is-objective","mgx:unlocks-with","mgx:is-npc","mgx:acts-on-turn","mgx:acts-toward","mgx:is-container","mgx:is-open"]);KE=new Set(["owl:onProperty","owl:someValuesFrom","owl:allValuesFrom"]),Pm=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:works-in"]);en=e=>`${e.subject} ${ES(e.predicate)} ${e.object}`;JP=Object.entries(Fs).filter(([e])=>!Pm.has(e)).map(([e,t])=>{let n=/^(?:is|are)\s+(.+)$/i.exec(t);return n?{predicate:e,marker:n[1].trim().toLowerCase()}:null}).filter(e=>e&&e.marker.length>1).sort((e,t)=>t.marker.length-e.marker.length);ZP=/ \(source: [^)]*\)$/;eM=8;Gl=null;rM=/^(?:every|each|all|any)\s+/i;jS=new Set(["module","modules","class","classes","function","functions","method","methods","handler","handlers","controller","controllers","service","services","component","components","flow","flows","thing","things","item","items","object","objects","commit","commits"]),u7=new Set([["interpreter","compiler"],["string","thread"],["heart","kernel"],["battalion","heap"],["bash","sock"],["command","skill"],["docker","longshoreman"],["name","list"],["list","number"]].map(([e,t])=>[e,t].sort().join("|"))),Rm=/^(?:is|are|was|were)\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)\s+(?:the|an?)\s+([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,kS=/^(?:who|what)\s+(?:is|are)\s+(?:the|an?)\s+([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,iM=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]+(?:\s+[A-Z][\w-]*)?)'s\s+([a-z][\w-]*)[?.!\s]*$/i,aM=/^(who|what)'?s\s+/i,Xl=e=>String(e).replace(aM,(t,n)=>`${n} is `),cM=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]{2,}?)s\s+([a-z][\w-]*)[?.!\s]*$/i;lM=/^list\s+(?:the\s+|all\s+)?([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,mo=/^(?:is|are)\s+(?:an?\s+)?(.+?)\s+(?:a\s+kind\s+of|a\s+type\s+of|an?)\s+(.+?)[?.!\s]*$/i,Ln=new Set(["rdfs:subClassOf","rdf:type"]),uM=6,dM=/^why\s+(?=(?:is|are)\b)/i,fM=/^explain\s+how\s+you\s+know\s+(?:that\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i;Tm=new Set(["kind","sort","type","subclass","superclass"]),ZE=/^(?:so\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)\s*,?\s*(?:now\s+)?(?:right|correct|yeah)\??$/i,pM=/^(?:what\s+do\s+you\s+know\s+about|what(?:'s|s|\s+is)\s+in\s+your\s+memory\s+about|what\s+do\s+you\s+remember\s+about)\s+(.+?)[?.!\s]*$/i,Re=32;hM=/^(?:can|could)\s+(all\s+|every\s+)?(?:an?\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z]+)[?.!\s]*$/i,gM=/^(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+have\s+(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i,bM=/^how\s+many\s+(.+?)\s+(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+have[?.!\s]*$/i,eS=new Set(["mgx:hasA","tmct:has"]),wM=/^(?:can|could)\s+(?:all\s+|every\s+)?(?:an?\s+|the\s+)?(.+?)\s+be\s+([a-z][\w-]*)[?.!\s]*$/i;vM=/^(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+([a-z]+)\s+(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i,xM=/^what\s+can\s+(?:an?\s+)?(.+?)\s+do[?.!\s]*$/i,EM=/^what\s+has\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,SM=/^what\s+(?:(?:can\s+be|is)\s+used\s+for|is\s+for)\s+(.+?)[?.!\s]*$/i,jM=/^where(?:'s|\s+is|\s+are)\s+(.+?)(?:\s+now)?\s*[?.!]*$/i,kM=/^where\s+(?:does|do|did)\s+(.+?)\s+[a-z][a-z'-]*(?:\s+now)?\s*[?.!]*$/i,RM=new RegExp(`^what(?:'s|\\s+is|\\s+are)\\s+(${Ke})\\s+(.+?)\\s*[?.!]*$`,"i"),_M=/^what(?:'s|\s+is|\s+are)\s+(?:the\s+)?(parts|members|contents)\s+of\s+(?:the\s+|an?\s+)?(.+?)\s*[?.!]*$/i,TM=/^what\s+([a-z][\w-]*)\s+(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+([a-z][a-z-]*)\s*[?.!]*$/i,AM=/^(?:do|does)\s+(all\s+|every\s+)?(?:an?\s+|the\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z-]+)[?.!\s]*$/i,CM=/^what\s+can\s+(?!be\s)(.+?)[?.!\s]*$/i,IM=/^what\s+(?:cannot|can't|cant|can\s+not)\s+(.+?)[?.!\s]*$/i,OM=/^(?:which|what)\s+([\w'-]+(?:\s+[\w'-]+)*?)\s+can\s+(.+?)[?.!\s]*$/i;nS=e=>String(e||"").replace(/\s+/g," ").trim();AS="(?:most|least)\\s+[a-z][\\w-]*|[a-z][\\w-]*est|best|worst",LM=new RegExp(`^which\\s+([\\w'-]+)\\s+(?:is|are)\\s+(?:the\\s+)?(${AS})[?.!\\s]*$`,"i"),PM=new RegExp(`^what(?:'s|s|\\s+is)\\s+the\\s+(${AS})\\s+([\\w'-]+)[?.!\\s]*$`,"i");FM=new Set(["rdfs:subClassOf","rdf:type","mgx:hasA","mgx:capableOf","mgx:usedFor","mgx:ownedBy","owl:disjointWith","mgx:hasProperty","mgx:receivesAction"]),DM=Object.entries(Fs).filter(([e])=>!FM.has(e)&&!Pm.has(e)).map(([e,t])=>({predicate:e,re:new RegExp(`^what\\s+${ot(t)}\\s+(.+?)[?.!\\s]*$`,"i")})).sort((e,t)=>t.re.source.length-e.re.source.length),zM=new Set(["rdfs:subClassOf","rdf:type","owl:disjointWith","mgx:hasProperty","mgx:hasA","mgx:capableOf","mgx:ownedBy"]),UM=new Set(["mgx:partOf","mgx:memberOf"]),BM=Object.entries(Fs).filter(([e])=>!zM.has(e)&&!Pm.has(e)).map(([e,t])=>{let n;if(t==="can be")n=new RegExp("^can\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+be\\s+(.+?)[?.!\\s]*$","i");else if(t.startsWith("is ")){let s=ot(t.slice(3));n=new RegExp(`^(?:is|are)\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+${s}\\s+(?:an?\\s+|the\\s+)?(.+?)[?.!\\s]*$`,"i")}else{let[s,...o]=t.split(" "),r=[Ql(s),...o].map(ot).join("\\s+");n=new RegExp(`^(?:does|do)\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+${r}\\s+(?:an?\\s+|the\\s+)?(.+?)[?.!\\s]*$`,"i")}return{predicate:e,phrase:t,re:n}}).sort((e,t)=>t.re.source.length-e.re.source.length),rS=/^what\s+(?:inherits?\s+(?:from\s+)?(?:an?\s+)?|is\s+(?:an?\s+)?(?:kind|sort|type)\s+of\s+|is\s+(?:an?\s+)?subclass\s+of\s+)(.+?)[?.!\s]*$/i,WM=new Set(["changed","change","changes","updated","modified","happened","occurred"]);VM=new Set(["owl:unionof","owl:complementof","owl:oneof","owl:allvaluesfrom","owl:mincardinality","owl:maxcardinality","owl:cardinality","rdfs:subpropertyof","owl:inverseof"]);XM=/^what\s+(?:did|have)\s+(?:i|we|you)\s+(?:told|tell|said|say)\s+(?:you|me|us)?\s*about\s+(.+?)[?.!\s]*$/i,JM=/^what\s+(?:kind|type)\s+of\s+(?:an?\s+)?([\w-]+(?:\s+[\w-]+)?)?\s*(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,QM=/^does\s+every\s+(.+?)\s+have\s+at\s+least\s+(\d+)\s+(.+?)[?.!\s]*$/i,ZM=/^does\s+an?\s+(.+?)\s+have\s+an?\s+(.+?)[?.!\s]*$/i,aS=new Set(["owl:cardinality","owl:minCardinality","owl:maxCardinality","owl:onClass"]),eF=/^who\s+(?:owns|maintains)\s+(.+?)[?.!\s]*$/i,tF=/^(?:does|did)\s+([\w'-]+)\s+(?:owns?|maintains?)\s+(.+?)[?.!\s]*$/i,nF=/^(?:is|are|was|were)\s+(.+?)\s+owned\s+by\s+([A-Za-z][\w'-]*(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,sF=/^(?:does|did)\s+([\w'-]+)\s+(?:has|have)\s+an?\s+([a-z][\w-]*)\s+method[?.!\s]*$/i,oF=/^what\s+methods\s+does\s+([\w'-]+)\s+have[?.!\s]*$/i,cS=/^(?:is|are|was|were)\s+(.+?)\s+([A-Za-z][\w-]*)[?.!\s]*$/i,Ds=/^(?:it|this|that)$/i,rF=/^(?:it|them|this|that|in|on|of|to|at)$/i,lS=/^(?:it|this|that)(?:\s+one)?\s+(?:before|after)\b/i,uS=/^(?:you|i|they|he|she|we)\b/i,dS=(e,t)=>({text:`I don't know anything about "${e}" yet \u2014 teach me directly, e.g. "remember that ${Yl(e)} is ${t}".`,replace:!0}),iF=/^(?:what\s+(?:did|have)\s+(?:i|we)\s+(?:told?|tell|said?|say)\s+(?:you|me|us)?(?:\s+(?:last\s+time|before|earlier|previously|already))?|what\s+facts?\s+do\s+you\s+(?:know|have|remember)|what\s+do\s+you\s+(?:know|remember)|what\s+have\s+you\s+(?:learned|learnt|remembered))[?.!\s]*$/i;cF=/inherit|supertype|subclass|extend|specializ/i,lF=8;d7=new RegExp(`\\b(?:${[...Cm].join("|")})\\b`,"i"),NS=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,dF=/^who\s+(?:is|are|was|were)\s+(?:an?\s+|the\s+)?([\w'-]+)[?.!\s]*$/i,fF=/^(?:please\s+|can\s+you\s+|could\s+you\s+)*(?:define|definition\s+of|give\s+me\s+the\s+definition\s+of)\s+(?:the\s+(?:term|word)\s+)?(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i;f7=new RegExp(`^(?:(?:the|a|an)\\s+)?(.+?)\\s+(${Object.keys(Ze).join("|")})$`,"i"),jm="(?:(?:can|could|would)\\s+you\\s+(?:please\\s+)?)?(?:(?:show|give)\\s+(?:me|us)\\s+|describe\\s+|explain\\s+|what(?:'s|s|\\s+is)\\s+)?",Am="(?:of|for)\\s+(?:this|the)\\s+(?:app|codebase|repo|repository|project|code)",pF=`(?:\\s+${Am})?`,p7=[new RegExp(`^${jm}the\\s+architecture(?:\\s+(?:overview|map|diagram))?${pF}(?:\\s+here)?\\??$`,"i"),new RegExp(`^${jm}architecture\\s+(?:${Am}|overview|map|diagram)\\??$`,"i"),new RegExp(`^${jm}(?:(?:an?|the)\\s+)?(?:overview|map|diagram)\\s+${Am}(?:\\s+here)?\\??$`,"i")],m7={find:"locate a specific named entity",search:"locate a specific named entity",context:"gather the sized edit bundle for a symbol before changing code",snippet:"view a symbol's exact source",describe:"look up a symbol's definition and relations",signature:"view a symbol's signature",members:Nn.contains,subclasses:Nn.inherits,impact:"understand what a change to this module would reach (impact closure)",callers:Nn.calls,callees:Nn.calls,tests:Nn.tests,untested:Nn.tests,history:Nn.touches,exports:Nn.reexports,arch:"understand the overall architecture (package/module boundaries)",capabilities:"see what /plan can plan over \u2014 built-in query tools and taught actions",goals:"see the declared goals a trace is recognized against, and where each one came from",syllogise:"materialize the entailed facts that follow from what's remembered about one term",wiki:"toggle the live Wikipedia supplement for questions nothing local can answer",wikipedia:"choose which source the research lane fetches from",wikidata:"choose which source the research lane fetches from",export:"write the memory store to a file, in the standard JSONL shape",ingest:"read a local text file and store every fact the recognizer grounds from it",news:"surface or work the news feed built over this graph"},PS="(?:changed?|modif(?:y|ied)|edits?|edited|touch(?:es|ed)?|updates?|updated|alters?|altered|deletes?|deleted|removes?|removed|drops?|dropped)",h7=new RegExp(`^what\\s+(?:would|will|might|could|does|do)?\\s*(?:breaks?|fails?|happens?|stops?\\s+working|is\\s+affected|are\\s+affected|gets?\\s+affected|be\\s+affected|is\\s+impacted|be\\s+impacted)\\s+if\\s+(?:i|we|you|one|someone)\\s+${PS}\\s+(?:the\\s+)?(.+?)[?.!\\s]*$`,"i"),g7=new RegExp(`^if\\s+(?:i|we|you|one|someone)\\s+${PS}\\s+(?:the\\s+)?(.+?),?\\s+what\\s+(?:would\\s+|will\\s+|might\\s+|could\\s+|does\\s+|do\\s+)?(?:breaks?|fails?|happens?|stops?\\s+working|is\\s+affected|are\\s+affected|gets?\\s+affected|be\\s+affected|would\\s+break|will\\s+break)[?.!\\s]*$`,"i"),b7=new RegExp("^what\\s+(?:is|are|gets?|would\\s+be|will\\s+be)\\s+(?:affected|impacted|broken)\\s+(?:by|when|if)\\s+(?:i\\s+|we\\s+|you\\s+)?(?:chang(?:e|es|ing)|edit(?:s|ing)?|modif(?:y|ies|ying)|touch(?:es|ing)?|updat(?:e|es|ing)|delet(?:e|es|ing)|remov(?:e|es|ing)|a\\s+change\\s+to)\\s+(?:the\\s+)?(.+?)[?.!\\s]*$","i"),w7=new RegExp("^(?:(?:can|could)\\s+(?:i|we|you|one|someone)\\s+safely|is\\s+it\\s+safe\\s+to)\\s+(?:change|edit|modify|touch|update|alter|delete|remove|drop)\\s+(?:the\\s+)?(.+?)[?.!\\s]*$","i"),y7=new RegExp("^(?:what(?:'s|\\s+is)\\s+the\\s+)?(?:blast\\s+radius|impact)\\s+(?:of|for)\\s+(?:chang(?:ing|es)\\s+|editing\\s+|modifying\\s+|touching\\s+|updating\\s+|deleting\\s+|removing\\s+)?(?:the\\s+)?(.+?)[?.!\\s]*$","i"),Zl="as\\s+(?:its|the|an?)?\\s*(?:base\\s+class|parent\\s+class|base|parent)",$7=new RegExp(`^(.+?)\\s+uses?\\s+(?:which\\s+[\\w'-]+|what)\\s+${Zl}\\s*\\??$`,"i"),v7=new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+uses?\\s+${Zl}\\s*\\??$`,"i"),x7=new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+uses?\\s+(.+?)\\s+${Zl}\\s*\\??$`,"i"),E7=new RegExp(`^(.+?)\\s+uses?\\s+(.+?)\\s+${Zl}\\s*[.!]*$`,"i"),mF=Object.freeze([...Cm].filter(e=>e!=="here").concat("they")),S7=new RegExp(`^((?:is|are|can|could|does|do)\\s+|what\\s+(?:is|are)\\s+)(${mF.join("|")})\\b(\\s+\\S.*)?$`,"i"),j7=ne(".tmct","memory","corpus-seed.json")});sa();qe();Dn();bl();var eu={uninformativeClassMaxShare:.35,uninformativeClassMinSubjects:12,entailedDepthPenalty:.2,minoritySensePenalty:.5,minScore:.05,groupSplitThreshold:4,openerConceptCount:2,maxObjectsPerBodySentence:4,maxBodySentences:4,closerRootCount:2,budget:{chatReply:5,researchPanel:10,cliDigest:12,ledgerTerm:8}};var DS=Object.freeze({"rdfs:subClassOf":"isa","rdf:type":"isa","mgx:atLocation":"location","mgx:locatedNear":"location","mgx:partOf":"partOf","mgx:memberOf":"partOf","mgx:capableOf":"capableOf","mgx:usedFor":"usedFor"}),Zo=Object.freeze(["isa","location","partOf","capableOf","usedFor","other"]),tu=e=>DS[e]||"other",gF=e=>Math.max(0,Math.min(1,e));function MS(e){let t=(e.sourceTypes||[]).map(n=>ws[n]??0);return t.length?Math.max(...t):typeof e.trust=="number"&&e.trust>0?e.trust:ws.entailed}function bF(e){return Array.isArray(e.environments)&&e.environments.length?!0:(e.sourceTypes||[]).includes("entailed")}function FS(e,t){let n=Number(t?.totalSubjects)||0;return n<=0?0:(Number(t?.classSubjectCounts?.[e])||0)/n}function zS(e,t,n={},s={}){let o={...eu,...s.config||{}},r=Number.isInteger(s.budget)?s.budget:o.budget.chatReply,i=(t||[]).filter(v=>v&&v.object&&v.object!==e),a=[],c=(Number(n?.totalSubjects)||0)>=o.uninformativeClassMinSubjects,l=[];for(let v of i){if(tu(v.predicate)==="isa"){let S=FS(v.object,n);if(c&&S>o.uninformativeClassMaxShare){a.push({row:v,family:"isa",reason:"uninformative-class",share:S});continue}}l.push(v)}let u=l.filter(v=>tu(v.predicate)==="isa").map(v=>v.object),d=gl(u,{subClassEdges:n.subClassEdges||[],disjointEdges:n.disjointEdges||[]}),p=new Map,f=new Map;for(let v of d.clusters){let S=0;for(let C of v.objects){f.set(C,v.label);let x=l.find(R=>R.object===C&&tu(R.predicate)==="isa");S+=x?MS(x):0}p.set(v.label,S)}let m=null,h=-1;for(let[v,S]of[...p].sort((C,x)=>C[0].localeCompare(x[0])))S>h&&(h=S,m=v);let g=[];for(let v of l){let S=tu(v.predicate),C=MS(v),x={provenance:C};if(bF(v)&&(C-=o.entailedDepthPenalty,x.entailed=!0),S==="isa"){let w=.6+.4*(1-FS(v.object,n));C*=w,x.informativeness=w;let T=f.get(v.object);m&&T&&T!==m&&(C-=o.minoritySensePenalty,x.minoritySense=T)}C=gF(C),g.push({row:v,family:S,score:C,reasons:x})}let b=[];for(let v of g)v.score<o.minScore?a.push({row:v.row,family:v.family,reason:"below-floor",score:v.score}):b.push(v);let y=new Map;for(let v of b)y.has(v.family)||y.set(v.family,[]),y.get(v.family).push(v);for(let v of y.values())v.sort((S,C)=>C.score-S.score||S.row.object.localeCompare(C.row.object));let $=Zo.filter(v=>y.has(v)).concat([...y.keys()].filter(v=>!Zo.includes(v)).sort()),E=[],_=!1;for(;E.length<r&&!_;){_=!0;for(let v of $){let S=y.get(v);if(S&&S.length&&(E.push(S.shift()),_=!1,E.length>=r))break}}for(let v of $)for(let S of y.get(v)||[])a.push({row:S.row,family:S.family,reason:"over-budget",score:S.score});return E.sort((v,S)=>{let C=Zo.indexOf(v.family),x=Zo.indexOf(S.family);return C-x||S.score-v.score||v.row.object.localeCompare(S.row.object)}),{term:e,selected:E,cut:a,senses:{split:d.split,clusters:d.clusters,dominantLabel:m}}}mi();it();var wF=new Set(["isa","location","partOf","capableOf","usedFor"]),yF=new Set(["single","several","chained","group","closer"]),US=(e,t)=>`${e}:${t}`;function Mm(e){let t=new Map;for(let n of e||[]){if(!n||typeof n.family!="string"||!wF.has(n.family)||typeof n.form!="string"||!yF.has(n.form)||typeof n.template!="string"||!n.template.trim())continue;let s=US(n.family,n.form);t.has(s)||t.set(s,{family:n.family,form:n.form,templates:[]});let o=t.get(s);o.templates.includes(n.template)||o.templates.push(n.template)}return t}var er=e=>`${ko(e)} ${e}`;function $F(e){let t=(e||[]).map(o=>String(o||"").trim()).filter(Boolean);if(!t.length)return"";let n=er(t[0]),s=t.slice(1);return s.length?`${n}, and so ${pi(s.map(er))}`:n}function vF(e,t,n,s){let o=String(e||"").trim(),r=(t||[]).map(c=>String(c||"").trim()).filter(Boolean),i=r[0]||"",a=String(s||"").trim();return{TERM:o,TERM_CAP:br(o),A_TERM:er(o),A_TERM_CAP:br(er(o)),TERMS:qa(o),TERMS_CAP:br(qa(o)),PRONOUN:"it",PRONOUN_CAP:"It",PARENT:a,A_PARENT:a?er(a):"",OBJECT:i,A_OBJECT:i?er(i):"",OBJECTS_A:pi(r.map(er)),OBJECTS_PLURAL:pi(r.map(qa)),OBJECTS_RAW:pi(r),CHAIN:$F(n&&n.length?n:r.slice(0,1))}}function xF(e,t){return String(e).replace(/\{([A-Z_]+)\}/g,(n,s)=>s in t?t[s]:"").replace(/\s+/g," ").replace(/\s+([.,;])/g,"$1").trim()}function zs(e,t,n,s={}){let o=(n||[]).filter(Boolean);if(!o.length)return null;let r=s.term??o[0].subject??"",i=s.form||(o.length>1?"several":"single"),a=e instanceof Map?e.get(US(t,i)):null,c=a?a.templates:null;if(!c||!c.length)return null;let l=s.variantSeed??"",u=rc(`${r}|${t}|${i}|${l}`)%c.length,d=s.objectsOverride||o.map(f=>f.object),p=xF(c[u],vF(r,d,s.chain,s.parent));return p?{text:p,rows:o,family:t,form:i}:null}mi();var EF=Zo.filter(e=>e!=="isa"&&e!=="other");function SF(e){let t=new Map;for(let n of e||[])t.has(n.family)||t.set(n.family,[]),t.get(n.family).push(n.row);return t}function BS(e,t){let n=Math.max(1,Math.trunc(t)||1),s=[];for(let o=0;o<(e||[]).length;o+=n)s.push(e.slice(o,o+n));return s}function jF(e,t){let n=c=>(t?.[c.object]||[])[1]||null,s=new Map;for(let c of e||[]){let l=n(c);l&&s.set(l,(s.get(l)||0)+1)}let o=new Map,r=[],i=[];for(let c of e||[]){let l=n(c);l&&s.get(l)>=2?(o.has(l)||(o.set(l,[]),r.push(l)),o.get(l).push(c)):i.push(c)}let a=r.map(c=>({parent:c,rows:o.get(c)}));return i.length&&a.push({parent:null,rows:i}),a}function kF(e,t,n){let s=new Map,o=new Map;for(let c of t||[]){let l=e?.[c.object];if(!Array.isArray(l)||l.length<2)continue;let u=l[l.length-1];!u||u===c.object||(s.set(u,(s.get(u)||0)+1),o.has(u)||o.set(u,[]),o.get(u).push(c))}let r=[...s.keys()].sort((c,l)=>s.get(l)-s.get(c)||c.localeCompare(l)).slice(0,Math.max(0,n)),i=[],a=new Set;for(let c of r)for(let l of o.get(c)||[])a.has(l.id)||(a.add(l.id),i.push(l));return{roots:r,rows:i}}function RF(e,t,n,s,o){let r=[];if(!e.length)return r;if(e.length===1){let p=t[e[0].object],f=p&&p.length>1?"chained":"single",m=zs(s,"isa",e,{term:n,form:f,chain:p});return m&&r.push({...m,role:"names-term",paragraph:"definition"}),r}if(e.length<=o.groupSplitThreshold){let p=zs(s,"isa",e,{term:n,form:"several"});return p&&r.push({...p,role:"names-term",paragraph:"definition"}),r}let i=e.slice(0,o.openerConceptCount),a=e.slice(o.openerConceptCount),c=zs(s,"isa",i,{term:n,form:i.length>1?"several":"single",variantSeed:n});c&&r.push({...c,role:"names-term",paragraph:"definition"});let l=[];for(let p of jF(a,t))for(let f of BS(p.rows,o.maxObjectsPerBodySentence))l.push({parent:p.parent,rows:f});if(l.length>o.maxBodySentences){let p=l.slice(0,o.maxBodySentences),f=p[p.length-1];for(let m of l.slice(o.maxBodySentences))f.rows=f.rows.concat(m.rows);f.parent=null,l=p}for(let p of l){let f=p.parent?zs(s,"isa",p.rows,{term:n,form:"group",parent:p.parent,variantSeed:p.parent}):zs(s,"isa",p.rows,{term:n,form:"several",variantSeed:n});f&&r.push({...f,role:"describes-isa",paragraph:"definition"})}let{roots:u,rows:d}=kF(t,e,o.closerRootCount);if(u.length){let p=zs(s,"isa",d.length?d:e,{term:n,form:"closer",objectsOverride:u,variantSeed:n});p&&r.push({...p,role:"closes-isa",paragraph:"definition"})}return r}function _F(e,t){if(!e.length)return;let n=e[0];if(/\bnames-term\b/.test(n.role))return;let s=br(`${ko(t)} ${t}`);n.text=n.text.replace(/^It\b/,s),n.role="names-term"}function TF(e,t){let n=[],s=null,o=null;for(let r of e)(!s||r.paragraph!==o||s.length>=t)&&(s=[],o=r.paragraph,n.push(s)),s.push(r);return n.map(r=>({sentences:r,text:r.map(i=>i.text).join(" ")}))}function WS(e,t,n={}){let s=e?.term||"",o=Number.isInteger(n.maxSentencesPerParagraph)?n.maxSentencesPerParagraph:3,r=n.chains||{},i={...eu,...n.config||{}},a=SF(e?.selected||[]),c=[];for(let u of RF(a.get("isa")||[],r,s,t,i))c.push(u);for(let u of EF){let d=a.get(u);if(!(!d||!d.length))for(let p of BS(d,i.maxObjectsPerBodySentence)){let f=zs(t,u,p,{term:s});f&&c.push({...f,role:"describes",paragraph:"description"})}}_F(c,s);let l=new Map;for(let u of c)for(let d of u.rows)l.has(d.id)||l.set(d.id,d);return{term:s,sentences:c,paragraphs:TF(c,o),provenanceRows:[...l.values()]}}var AF=e=>({subject:e.subject,predicate:e.predicate,object:e.object,sourceTypes:e.sourceTypes||[],provenance:e.provenance||""});function CF(e){let t=new Set,n=[];for(let s of e||[]){let o=s.provenance||(s.sourceTypes||[]).join(",");!o||t.has(o)||(t.add(o),n.push({provenance:s.provenance||"",sourceTypes:s.sourceTypes||[]}))}return n}var IF=Object.freeze({facts:"show the facts",chains:"show the chains"});function OF(e,t){let n=[...(e?.selected||[]).map(o=>o.row),...(e?.cut||[]).map(o=>o.row)].filter(Boolean),s=Object.entries(t||{}).filter(([,o])=>Array.isArray(o)&&o.length>1).map(([o,r])=>({object:o,chain:r}));return{escapes:IF,facts:n.map(AF),factCount:n.length,chains:s}}function GS(e,t,n={}){let s=t?.term||e?.term||"";return{kind:"term-article",term:s,headline:s,paragraphs:(t?.paragraphs||[]).map(o=>o.text).filter(Boolean),body:t?.paragraphs||[],sources:CF(t?.provenanceRows||[]),detail:OF(e,n.chains),provenanceRows:t?.provenanceRows||[]}}function VS(e,t,n={},s=new Map,o={}){let r=zS(e,t,n,o),i=WS(r,s,o);return GS(r,i,o)}bl();na();var HS=new Set(["rdfs:subClassOf","rdf:type"]);function qS(e){let t=new Map,n=new Set,s=[],o=[];for(let i of e||[])!i||!i.predicate||(HS.has(i.predicate)?(n.add(i.subject),t.has(i.object)||t.set(i.object,new Set),t.get(i.object).add(i.subject),s.push([i.subject,i.object])):i.predicate==="owl:disjointWith"&&o.push([i.subject,i.object]));let r={};for(let[i,a]of t)r[i]=a.size;return{classSubjectCounts:r,totalSubjects:n.size,subClassEdges:s,disjointEdges:o}}function KS(e,t,n=6){let s=oa(e||[]),o={};for(let r of t||[]){if(r in o)continue;let i=hl(r,s,{cap:n,stopAt:pl});i.length>1&&(o[r]=i)}return o}function YS(e){let t=[],n=new Set;for(let s of e||[])!s||!HS.has(s.predicate)||n.has(s.object)||(n.add(s.object),t.push(s.object));return t}qe();sa();function NF(e,t,n,s,o={}){let r=Mm(s||[]);if(!r||r.size===0)return null;let i=t||[],a=qS(n||i),c=KS(a.subClassEdges,YS(i));return VS(e,i,a,r,{...o,chains:c})}function XS(e,t,n,s={}){let o=bt(e||{individuals:[],objectProperties:[]}),r=ee(q,t),i=o.filter(c=>r.has(c.subject));if(!i.length)return null;let a=NF(t,i,o,n,s);return LF(a)}function LF(e){if(!e||!Array.isArray(e.paragraphs)||!e.paragraphs.length)return null;let t=e.detail&&Array.isArray(e.detail.facts)?e.detail.facts:[];return{term:e.term||"",paragraphs:e.paragraphs.slice(),sources:[...new Set((e.sources||[]).map(n=>n.provenance).filter(Boolean))],facts:t,factCount:e.detail&&Number.isInteger(e.detail.factCount)?e.detail.factCount:t.length}}var PF="no session is open on this page yet \u2014 await tmct.open() first",JS=Symbol.for("tmct.surface.fallback");function QS({open:e,ask:t=null,plan:n=null,turn:s=null,page:o={},fallback:r=!1,target:i=globalThis}={}){if(typeof e!="function")throw new Error("publishTmctSurface: `open` must be this page's session factory");let a=i.tmct;if(r&&a&&!a[JS])return a;let c=null,l=()=>{if(!c)throw new Error(PF);return c},u={async open(...d){return c=await e(...d),c},get session(){return c},async turn(d,p){let f=l();return s?s(d,p,f):typeof f.turn!="function"?{answer:"this page runs no conversational turn \u2014 see tmct.session for what it does run",end:!1,record:null,plan:null,research:null}:f.turn(d,p)},async ask(d,p){return t?t(d,p,l()):{answer:"this page has no separate ask route \u2014 it answers questions through tmct.turn()",data:void 0,miss:!0}},async plan(d,p){return n?n(d,p,l()):{refused:!0,why:"this page's bundle carries no capability planner",driver:null,calls:[],composed:null,observed:null}},page:o,fallback:r};return u[JS]=r,i.tmct=u,u}function MF({payload:e=null}={}){let t=Ui();return e&&(t.payload=e),{memoryDir:t}}async function FF(e,t,n){let s=null;try{s=await CS(n.memoryDir,e,null,!0,{})}catch{s=null}if(!(s&&s.text))try{s=await OS(n.memoryDir,e,null,!0,null)}catch{s=null}return s&&s.text?{answer:s.text,data:s,miss:!1}:{answer:null,data:null,miss:!0}}QS({open:MF,ask:FF,page:{normFactTerm:q,digestTermFromPayloadBrowser:XS},fallback:!0});})();